From 7b6575c223400ab78e4fe70e9583b12e772180ca Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Fri, 28 Jun 2019 13:19:18 -0700 Subject: [PATCH] Network with api version 2019_02_01 (#3463) * regenerated network with api version 2019_02_01 * updated parent versioning in pom * Update pom.xml --- network/resource-manager/v2019_02_01/pom.xml | 133 + .../network/v2019_02_01/Access.java | 41 + .../network/v2019_02_01/AddressSpace.java | 46 + .../v2019_02_01/ApplicationGateway.java | 858 +++++ ...ationGatewayAuthenticationCertificate.java | 152 + ...licationGatewayAutoscaleConfiguration.java | 69 + ...ApplicationGatewayAvailableSslOptions.java | 68 + ...tionGatewayAvailableWafRuleSetsResult.java | 26 + .../ApplicationGatewayBackendAddress.java | 69 + .../ApplicationGatewayBackendAddressPool.java | 180 + .../ApplicationGatewayBackendHealth.java | 26 + ...ationGatewayBackendHealthHttpSettings.java | 70 + ...plicationGatewayBackendHealthOnDemand.java | 30 + .../ApplicationGatewayBackendHealthPool.java | 70 + ...ApplicationGatewayBackendHealthServer.java | 123 + ...ationGatewayBackendHealthServerHealth.java | 50 + ...ApplicationGatewayBackendHttpSettings.java | 470 +++ .../ApplicationGatewayConnectionDraining.java | 72 + ...ApplicationGatewayCookieBasedAffinity.java | 41 + .../ApplicationGatewayCustomError.java | 70 + ...plicationGatewayCustomErrorStatusCode.java | 41 + ...ationGatewayFirewallDisabledRuleGroup.java | 71 + .../ApplicationGatewayFirewallExclusion.java | 97 + .../ApplicationGatewayFirewallMode.java | 41 + .../ApplicationGatewayFirewallRule.java | 69 + .../ApplicationGatewayFirewallRuleGroup.java | 96 + .../ApplicationGatewayFirewallRuleSet.java | 153 + ...icationGatewayFrontendIPConfiguration.java | 231 ++ .../ApplicationGatewayFrontendPort.java | 151 + ...ApplicationGatewayHeaderConfiguration.java | 69 + .../ApplicationGatewayHttpListener.java | 308 ++ .../ApplicationGatewayIPConfiguration.java | 154 + .../ApplicationGatewayOnDemandProbe.java | 232 ++ .../ApplicationGatewayOperationalState.java | 47 + .../ApplicationGatewayPathRule.java | 256 ++ .../v2019_02_01/ApplicationGatewayProbe.java | 369 ++ ...cationGatewayProbeHealthResponseMatch.java | 72 + .../ApplicationGatewayProtocol.java | 41 + ...plicationGatewayRedirectConfiguration.java | 309 ++ .../ApplicationGatewayRedirectType.java | 47 + .../ApplicationGatewayRequestRoutingRule.java | 308 ++ ...licationGatewayRequestRoutingRuleType.java | 41 + .../ApplicationGatewayRewriteRule.java | 123 + ...pplicationGatewayRewriteRuleActionSet.java | 70 + ...pplicationGatewayRewriteRuleCondition.java | 124 + .../ApplicationGatewayRewriteRuleSet.java | 105 + .../v2019_02_01/ApplicationGatewaySku.java | 98 + .../ApplicationGatewaySkuName.java | 56 + .../ApplicationGatewaySslCertificate.java | 233 ++ .../ApplicationGatewaySslCipherSuite.java | 110 + .../ApplicationGatewaySslPolicy.java | 152 + .../ApplicationGatewaySslPolicyName.java | 44 + .../ApplicationGatewaySslPolicyType.java | 41 + ...ApplicationGatewaySslPredefinedPolicy.java | 41 + .../ApplicationGatewaySslProtocol.java | 44 + .../v2019_02_01/ApplicationGatewayTier.java | 47 + ...licationGatewayTrustedRootCertificate.java | 179 + .../ApplicationGatewayUrlPathMap.java | 257 ++ ...ayWebApplicationFirewallConfiguration.java | 280 ++ .../v2019_02_01/ApplicationGateways.java | 124 + .../v2019_02_01/ApplicationSecurityGroup.java | 83 + .../ApplicationSecurityGroups.java | 25 + .../network/v2019_02_01/AssociationType.java | 41 + .../v2019_02_01/AuthenticationMethod.java | 41 + .../v2019_02_01/AuthorizationUseStatus.java | 41 + .../network/v2019_02_01/Availability.java | 95 + .../v2019_02_01/AvailableDelegations.java | 28 + .../AvailableEndpointServices.java | 27 + .../v2019_02_01/AvailableProvidersList.java | 26 + .../AvailableProvidersListCity.java | 70 + .../AvailableProvidersListCountry.java | 96 + .../AvailableProvidersListParameters.java | 122 + .../AvailableProvidersListState.java | 96 + .../AvailableResourceGroupDelegations.java | 28 + .../AzureAsyncOperationResult.java | 78 + .../network/v2019_02_01/AzureFirewall.java | 248 ++ .../AzureFirewallApplicationRule.java | 174 + ...zureFirewallApplicationRuleCollection.java | 169 + .../AzureFirewallApplicationRuleProtocol.java | 70 + ...reFirewallApplicationRuleProtocolType.java | 41 + .../v2019_02_01/AzureFirewallFqdnTag.java | 38 + .../v2019_02_01/AzureFirewallFqdnTags.java | 19 + .../AzureFirewallIPConfiguration.java | 159 + .../v2019_02_01/AzureFirewallNatRCAction.java | 43 + .../AzureFirewallNatRCActionType.java | 41 + .../v2019_02_01/AzureFirewallNatRule.java | 227 ++ .../AzureFirewallNatRuleCollection.java | 169 + .../v2019_02_01/AzureFirewallNetworkRule.java | 174 + .../AzureFirewallNetworkRuleCollection.java | 169 + .../AzureFirewallNetworkRuleProtocol.java | 47 + .../v2019_02_01/AzureFirewallRCAction.java | 43 + .../AzureFirewallRCActionType.java | 41 + .../AzureFirewallThreatIntelMode.java | 44 + .../network/v2019_02_01/AzureFirewalls.java | 25 + .../v2019_02_01/AzureReachabilityReport.java | 36 + .../AzureReachabilityReportItem.java | 96 + .../AzureReachabilityReportLatencyInfo.java | 71 + .../AzureReachabilityReportLocation.java | 95 + .../AzureReachabilityReportParameters.java | 149 + .../network/v2019_02_01/BGPCommunity.java | 175 + .../v2019_02_01/BackendAddressPool.java | 59 + .../network/v2019_02_01/BgpPeerState.java | 50 + .../network/v2019_02_01/BgpPeerStatus.java | 138 + .../v2019_02_01/BgpPeerStatusListResult.java | 26 + .../v2019_02_01/BgpServiceCommunities.java | 19 + .../v2019_02_01/BgpServiceCommunity.java | 34 + .../network/v2019_02_01/BgpSettings.java | 95 + .../v2019_02_01/CircuitConnectionStatus.java | 44 + .../ConnectionMonitorDestination.java | 95 + .../ConnectionMonitorParameters.java | 122 + .../ConnectionMonitorQueryResult.java | 31 + .../v2019_02_01/ConnectionMonitorResult.java | 260 ++ .../v2019_02_01/ConnectionMonitorSource.java | 69 + .../ConnectionMonitorSourceStatus.java | 44 + .../v2019_02_01/ConnectionMonitors.java | 86 + .../v2019_02_01/ConnectionResetSharedKey.java | 25 + .../v2019_02_01/ConnectionSharedKey.java | 30 + .../network/v2019_02_01/ConnectionState.java | 44 + .../v2019_02_01/ConnectionStateSnapshot.java | 270 ++ .../network/v2019_02_01/ConnectionStatus.java | 47 + .../v2019_02_01/ConnectivityDestination.java | 96 + .../network/v2019_02_01/ConnectivityHop.java | 108 + .../v2019_02_01/ConnectivityInformation.java | 56 + .../v2019_02_01/ConnectivityIssue.java | 83 + .../v2019_02_01/ConnectivityParameters.java | 122 + .../v2019_02_01/ConnectivitySource.java | 70 + .../network/v2019_02_01/Container.java | 17 + .../ContainerNetworkInterface.java | 183 + ...ontainerNetworkInterfaceConfiguration.java | 157 + ...tainerNetworkInterfaceIpConfiguration.java | 101 + .../v2019_02_01/DdosCustomPolicies.java | 23 + .../network/v2019_02_01/DdosCustomPolicy.java | 119 + .../v2019_02_01/DdosCustomPolicyProtocol.java | 44 + ...ustomPolicyTriggerSensitivityOverride.java | 47 + .../v2019_02_01/DdosProtectionPlan.java | 90 + .../v2019_02_01/DdosProtectionPlans.java | 25 + .../network/v2019_02_01/DdosSettings.java | 72 + .../DdosSettingsProtectionCoverage.java | 41 + .../v2019_02_01/DefaultSecurityRules.java | 40 + .../network/v2019_02_01/Delegation.java | 142 + .../network/v2019_02_01/DeviceProperties.java | 95 + .../network/v2019_02_01/DhGroup.java | 59 + .../network/v2019_02_01/DhcpOptions.java | 46 + .../network/v2019_02_01/Dimension.java | 95 + .../network/v2019_02_01/Direction.java | 41 + .../EffectiveNetworkSecurityGroup.java | 124 + ...ectiveNetworkSecurityGroupAssociation.java | 70 + ...fectiveNetworkSecurityGroupListResult.java | 31 + .../EffectiveNetworkSecurityRule.java | 420 +++ .../network/v2019_02_01/EffectiveRoute.java | 206 ++ .../v2019_02_01/EffectiveRouteListResult.java | 31 + .../v2019_02_01/EffectiveRouteSource.java | 47 + .../v2019_02_01/EffectiveRouteState.java | 41 + .../EffectiveSecurityRuleProtocol.java | 44 + .../network/v2019_02_01/EndpointService.java | 44 + .../v2019_02_01/EndpointServiceResult.java | 35 + .../management/network/v2019_02_01/Error.java | 148 + .../network/v2019_02_01/ErrorDetails.java | 95 + .../network/v2019_02_01/ErrorException.java | 44 + .../network/v2019_02_01/ErrorResponse.java | 44 + .../v2019_02_01/ErrorResponseException.java | 44 + .../EvaluatedNetworkSecurityGroup.java | 111 + .../network/v2019_02_01/EvaluationState.java | 44 + .../v2019_02_01/ExpressRouteCircuit.java | 488 +++ .../ExpressRouteCircuitArpTable.java | 121 + .../ExpressRouteCircuitAuthorization.java | 223 ++ .../ExpressRouteCircuitAuthorizations.java | 53 + .../ExpressRouteCircuitConnection.java | 288 ++ .../ExpressRouteCircuitConnections.java | 56 + .../ExpressRouteCircuitPeering.java | 696 ++++ ...uitPeeringAdvertisedPublicPrefixState.java | 47 + .../ExpressRouteCircuitPeeringConfig.java | 177 + .../ExpressRouteCircuitPeeringId.java | 43 + .../ExpressRouteCircuitPeeringState.java | 41 + .../ExpressRouteCircuitPeerings.java | 53 + .../ExpressRouteCircuitReference.java | 43 + .../ExpressRouteCircuitRoutesTable.java | 148 + ...ExpressRouteCircuitRoutesTableSummary.java | 149 + ...RouteCircuitServiceProviderProperties.java | 95 + .../v2019_02_01/ExpressRouteCircuitSku.java | 98 + .../ExpressRouteCircuitSkuFamily.java | 41 + .../ExpressRouteCircuitSkuTier.java | 47 + .../v2019_02_01/ExpressRouteCircuitStats.java | 40 + .../v2019_02_01/ExpressRouteCircuits.java | 82 + ...xpressRouteCircuitsArpTableListResult.java | 31 + ...essRouteCircuitsRoutesTableListResult.java | 31 + ...eCircuitsRoutesTableSummaryListResult.java | 31 + .../v2019_02_01/ExpressRouteConnection.java | 223 ++ .../v2019_02_01/ExpressRouteConnectionId.java | 32 + .../ExpressRouteConnectionList.java | 27 + .../v2019_02_01/ExpressRouteConnections.java | 53 + .../ExpressRouteCrossConnection.java | 269 ++ .../ExpressRouteCrossConnectionPeering.java | 475 +++ .../ExpressRouteCrossConnectionPeerings.java | 53 + ...outeCrossConnectionRoutesTableSummary.java | 123 + .../ExpressRouteCrossConnections.java | 59 + ...nnectionsRoutesTableSummaryListResult.java | 31 + .../v2019_02_01/ExpressRouteGateway.java | 154 + ...tewayPropertiesAutoScaleConfiguration.java | 43 + ...ropertiesAutoScaleConfigurationBounds.java | 69 + .../v2019_02_01/ExpressRouteGateways.java | 25 + .../network/v2019_02_01/ExpressRouteLink.java | 72 + .../ExpressRouteLinkAdminState.java | 41 + .../ExpressRouteLinkConnectorType.java | 41 + .../v2019_02_01/ExpressRouteLinks.java | 40 + .../v2019_02_01/ExpressRoutePeeringState.java | 41 + .../v2019_02_01/ExpressRoutePeeringType.java | 44 + .../network/v2019_02_01/ExpressRoutePort.java | 251 ++ .../v2019_02_01/ExpressRoutePorts.java | 25 + .../ExpressRoutePortsEncapsulation.java | 41 + .../ExpressRoutePortsLocation.java | 44 + .../ExpressRoutePortsLocationBandwidths.java | 48 + .../ExpressRoutePortsLocations.java | 29 + .../ExpressRouteServiceProvider.java | 39 + ...RouteServiceProviderBandwidthsOffered.java | 69 + .../ExpressRouteServiceProviders.java | 19 + .../v2019_02_01/FlowLogFormatParameters.java | 69 + .../v2019_02_01/FlowLogFormatType.java | 38 + .../v2019_02_01/FlowLogInformation.java | 50 + .../v2019_02_01/FlowLogStatusParameters.java | 45 + .../v2019_02_01/FrontendIPConfiguration.java | 94 + .../network/v2019_02_01/GatewayRoute.java | 122 + .../v2019_02_01/GatewayRouteListResult.java | 26 + .../GetVpnSitesConfigurationRequest.java | 71 + .../v2019_02_01/HTTPConfiguration.java | 96 + .../network/v2019_02_01/HTTPHeader.java | 69 + .../network/v2019_02_01/HTTPMethod.java | 38 + .../HubVirtualNetworkConnection.java | 63 + .../HubVirtualNetworkConnectionStatus.java | 47 + .../HubVirtualNetworkConnections.java | 40 + .../IPAddressAvailabilityResult.java | 31 + .../v2019_02_01/IPAllocationMethod.java | 41 + .../network/v2019_02_01/IPConfiguration.java | 207 ++ .../v2019_02_01/IPConfigurationProfile.java | 130 + .../network/v2019_02_01/IPVersion.java | 41 + .../network/v2019_02_01/IkeEncryption.java | 56 + .../network/v2019_02_01/IkeIntegrity.java | 53 + .../network/v2019_02_01/InboundNatPool.java | 321 ++ .../network/v2019_02_01/InboundNatRule.java | 398 ++ .../network/v2019_02_01/InboundNatRules.java | 53 + .../v2019_02_01/InterfaceEndpoint.java | 201 + .../v2019_02_01/InterfaceEndpoints.java | 25 + .../network/v2019_02_01/IpFlowProtocol.java | 41 + .../management/network/v2019_02_01/IpTag.java | 70 + .../network/v2019_02_01/IpsecEncryption.java | 62 + .../network/v2019_02_01/IpsecIntegrity.java | 53 + .../network/v2019_02_01/IpsecPolicy.java | 236 ++ .../Ipv6ExpressRouteCircuitPeeringConfig.java | 149 + .../network/v2019_02_01/IssueType.java | 62 + .../network/v2019_02_01/LoadBalancer.java | 394 ++ .../LoadBalancerBackendAddressPools.java | 40 + .../LoadBalancerFrontendIPConfigurations.java | 40 + .../LoadBalancerLoadBalancingRules.java | 40 + .../LoadBalancerNetworkInterface.java | 118 + .../LoadBalancerNetworkInterfaces.java | 29 + .../LoadBalancerOutboundRuleProtocol.java | 44 + .../LoadBalancerOutboundRules.java | 40 + .../v2019_02_01/LoadBalancerProbes.java | 40 + .../network/v2019_02_01/LoadBalancerSku.java | 44 + .../v2019_02_01/LoadBalancerSkuName.java | 41 + .../network/v2019_02_01/LoadBalancers.java | 25 + .../v2019_02_01/LoadBalancingRule.java | 98 + .../network/v2019_02_01/LoadDistribution.java | 44 + .../v2019_02_01/LocalNetworkGateway.java | 218 ++ .../v2019_02_01/LocalNetworkGateways.java | 24 + .../LocationAvailableDelegation.java | 46 + .../LocationAvailableDelegationModel.java | 46 + .../network/v2019_02_01/LogSpecification.java | 95 + .../v2019_02_01/ManagedServiceIdentity.java | 108 + ...ceIdentityUserAssignedIdentitiesValue.java | 47 + .../network/v2019_02_01/MatchCondition.java | 150 + .../network/v2019_02_01/MatchVariable.java | 71 + .../network/v2019_02_01/MatchedRule.java | 70 + .../v2019_02_01/MetricSpecification.java | 382 ++ .../network/v2019_02_01/NatGateway.java | 278 ++ .../network/v2019_02_01/NatGatewaySku.java | 43 + .../v2019_02_01/NatGatewaySkuName.java | 38 + .../network/v2019_02_01/NatGateways.java | 25 + ...workConfigurationDiagnosticParameters.java | 99 + ...NetworkConfigurationDiagnosticProfile.java | 150 + ...etworkConfigurationDiagnosticResponse.java | 26 + .../NetworkConfigurationDiagnosticResult.java | 70 + .../v2019_02_01/NetworkIntentPolicy.java | 73 + .../NetworkIntentPolicyConfiguration.java | 71 + .../network/v2019_02_01/NetworkInterface.java | 407 ++ .../NetworkInterfaceAssociation.java | 60 + .../NetworkInterfaceDnsSettings.java | 158 + .../NetworkInterfaceIPConfigurations.java | 40 + .../NetworkInterfaceLoadBalancer.java | 102 + .../NetworkInterfaceLoadBalancers.java | 29 + ...erfaceNetworkInterfaceIPConfiguration.java | 98 + .../NetworkInterfaceTapConfiguration.java | 200 + .../NetworkInterfaceTapConfigurations.java | 53 + .../v2019_02_01/NetworkInterfaces.java | 142 + .../v2019_02_01/NetworkOperationStatus.java | 44 + .../network/v2019_02_01/NetworkProfile.java | 166 + .../network/v2019_02_01/NetworkProfiles.java | 25 + .../v2019_02_01/NetworkSecurityGroup.java | 225 ++ .../NetworkSecurityGroupResult.java | 60 + .../NetworkSecurityGroupSecurityRule.java | 590 +++ ...NetworkSecurityGroupSecurityRuleModel.java | 118 + .../v2019_02_01/NetworkSecurityGroups.java | 25 + .../NetworkSecurityRulesEvaluationResult.java | 173 + .../network/v2019_02_01/NetworkWatcher.java | 126 + .../network/v2019_02_01/NetworkWatchers.java | 158 + .../v2019_02_01/NextHopParameters.java | 123 + .../network/v2019_02_01/NextHopResult.java | 35 + .../network/v2019_02_01/NextHopType.java | 53 + .../v2019_02_01/OfficeTrafficCategory.java | 47 + .../network/v2019_02_01/Operation.java | 40 + .../network/v2019_02_01/OperationDisplay.java | 121 + ...nPropertiesFormatServiceSpecification.java | 70 + .../network/v2019_02_01/Operations.java | 27 + .../network/v2019_02_01/Origin.java | 44 + .../network/v2019_02_01/OutboundRule.java | 74 + .../network/v2019_02_01/P2SVpnGateway.java | 253 ++ .../v2019_02_01/P2SVpnProfileParameters.java | 44 + ...rverConfigRadiusClientRootCertificate.java | 115 + ...rverConfigRadiusServerRootCertificate.java | 116 + ...rverConfigVpnClientRevokedCertificate.java | 115 + ...nServerConfigVpnClientRootCertificate.java | 116 + .../P2SVpnServerConfiguration.java | 438 +++ .../network/v2019_02_01/P2sVpnGateways.java | 35 + .../P2sVpnServerConfigurations.java | 53 + .../v2019_02_01/PacketCaptureFilter.java | 161 + .../v2019_02_01/PacketCaptureParameters.java | 174 + .../PacketCaptureQueryStatusResult.java | 52 + .../v2019_02_01/PacketCaptureResult.java | 244 ++ .../PacketCaptureStorageLocation.java | 100 + .../network/v2019_02_01/PacketCaptures.java | 75 + .../network/v2019_02_01/PatchRouteFilter.java | 164 + .../v2019_02_01/PatchRouteFilterRule.java | 156 + .../network/v2019_02_01/PcError.java | 50 + .../network/v2019_02_01/PcProtocol.java | 44 + .../network/v2019_02_01/PcStatus.java | 50 + .../PeerExpressRouteCircuitConnection.java | 73 + .../PeerExpressRouteCircuitConnections.java | 42 + .../network/v2019_02_01/PfsGroup.java | 62 + .../network/v2019_02_01/PolicySettings.java | 71 + .../PrepareNetworkPoliciesRequest.java | 97 + .../management/network/v2019_02_01/Probe.java | 74 + .../network/v2019_02_01/ProbeProtocol.java | 44 + .../v2019_02_01/ProcessorArchitecture.java | 41 + .../network/v2019_02_01/Protocol.java | 47 + .../v2019_02_01/ProtocolConfiguration.java | 43 + .../ProtocolCustomSettingsFormat.java | 127 + .../v2019_02_01/ProvisioningState.java | 47 + .../network/v2019_02_01/PublicIPAddress.java | 452 +++ .../PublicIPAddressDnsSettings.java | 104 + .../v2019_02_01/PublicIPAddressSku.java | 44 + .../v2019_02_01/PublicIPAddressSkuName.java | 41 + .../v2019_02_01/PublicIPAddresses.java | 62 + .../network/v2019_02_01/PublicIPPrefix.java | 359 ++ .../v2019_02_01/PublicIPPrefixSku.java | 43 + .../v2019_02_01/PublicIPPrefixSkuName.java | 38 + .../network/v2019_02_01/PublicIPPrefixes.java | 25 + .../QueryTroubleshootingParameters.java | 43 + .../ReferencedPublicIpAddress.java | 43 + .../v2019_02_01/ResourceIdentityType.java | 59 + .../v2019_02_01/ResourceNavigationLink.java | 129 + .../RetentionPolicyParameters.java | 69 + .../management/network/v2019_02_01/Route.java | 264 ++ .../network/v2019_02_01/RouteFilter.java | 139 + .../network/v2019_02_01/RouteFilterRule.java | 198 + .../network/v2019_02_01/RouteFilterRules.java | 53 + .../network/v2019_02_01/RouteFilters.java | 25 + .../network/v2019_02_01/RouteNextHopType.java | 50 + .../network/v2019_02_01/RouteTable.java | 191 + .../network/v2019_02_01/RouteTables.java | 25 + .../network/v2019_02_01/Routes.java | 53 + .../SecurityGroupNetworkInterface.java | 69 + .../SecurityGroupViewParameters.java | 43 + .../v2019_02_01/SecurityGroupViewResult.java | 26 + .../v2019_02_01/SecurityRuleAccess.java | 41 + .../v2019_02_01/SecurityRuleAssociations.java | 123 + .../v2019_02_01/SecurityRuleDirection.java | 41 + .../v2019_02_01/SecurityRuleProtocol.java | 50 + .../network/v2019_02_01/SecurityRules.java | 53 + .../v2019_02_01/ServiceAssociationLink.java | 129 + .../v2019_02_01/ServiceEndpointPolicies.java | 25 + .../v2019_02_01/ServiceEndpointPolicy.java | 143 + .../ServiceEndpointPolicyDefinition.java | 253 ++ .../ServiceEndpointPolicyDefinitions.java | 53 + .../ServiceEndpointPropertiesFormat.java | 96 + .../ServiceProviderProvisioningState.java | 47 + .../network/v2019_02_01/Severity.java | 41 + .../network/v2019_02_01/Subnet.java | 504 +++ .../v2019_02_01/SubnetAssociation.java | 60 + .../network/v2019_02_01/Subnets.java | 65 + .../network/v2019_02_01/TagsObject.java | 44 + .../network/v2019_02_01/Topology.java | 42 + .../v2019_02_01/TopologyAssociation.java | 96 + .../v2019_02_01/TopologyParameters.java | 96 + .../network/v2019_02_01/TopologyResource.java | 123 + ...afficAnalyticsConfigurationProperties.java | 148 + .../TrafficAnalyticsProperties.java | 43 + .../v2019_02_01/TransportProtocol.java | 44 + .../v2019_02_01/TroubleshootingDetails.java | 148 + .../TroubleshootingParameters.java | 97 + .../TroubleshootingRecommendedActions.java | 123 + .../v2019_02_01/TroubleshootingResult.java | 42 + .../v2019_02_01/TunnelConnectionHealth.java | 93 + .../v2019_02_01/TunnelConnectionStatus.java | 47 + .../management/network/v2019_02_01/Usage.java | 45 + .../network/v2019_02_01/UsageName.java | 69 + .../network/v2019_02_01/Usages.java | 28 + .../network/v2019_02_01/VerbosityLevel.java | 44 + .../VerificationIPFlowParameters.java | 231 ++ .../v2019_02_01/VerificationIPFlowResult.java | 30 + .../network/v2019_02_01/VirtualHub.java | 308 ++ .../network/v2019_02_01/VirtualHubId.java | 45 + .../network/v2019_02_01/VirtualHubRoute.java | 70 + .../v2019_02_01/VirtualHubRouteTable.java | 44 + .../network/v2019_02_01/VirtualHubs.java | 25 + ...aleSetNetworkInterfaceIPConfiguration.java | 98 + .../network/v2019_02_01/VirtualNetwork.java | 362 ++ ...tualNetworkConnectionGatewayReference.java | 43 + .../v2019_02_01/VirtualNetworkGateway.java | 423 +++ .../VirtualNetworkGatewayConnection.java | 508 +++ ...ualNetworkGatewayConnectionListEntity.java | 148 + ...rtualNetworkGatewayConnectionProtocol.java | 41 + ...VirtualNetworkGatewayConnectionStatus.java | 47 + .../VirtualNetworkGatewayConnectionType.java | 47 + .../VirtualNetworkGatewayConnections.java | 57 + .../VirtualNetworkGatewayIPConfiguration.java | 168 + .../v2019_02_01/VirtualNetworkGatewaySku.java | 99 + .../VirtualNetworkGatewaySkuName.java | 74 + .../VirtualNetworkGatewaySkuTier.java | 74 + .../VirtualNetworkGatewayType.java | 41 + .../v2019_02_01/VirtualNetworkGateways.java | 162 + .../v2019_02_01/VirtualNetworkPeering.java | 393 ++ .../VirtualNetworkPeeringState.java | 44 + .../v2019_02_01/VirtualNetworkPeerings.java | 53 + .../v2019_02_01/VirtualNetworkTap.java | 202 + .../v2019_02_01/VirtualNetworkTaps.java | 25 + .../v2019_02_01/VirtualNetworkUsage.java | 45 + .../v2019_02_01/VirtualNetworkUsageName.java | 47 + .../network/v2019_02_01/VirtualNetworks.java | 47 + .../network/v2019_02_01/VirtualWAN.java | 289 ++ .../VirtualWanSecurityProvider.java | 96 + .../VirtualWanSecurityProviderType.java | 41 + .../network/v2019_02_01/VirtualWans.java | 25 + .../v2019_02_01/VpnClientConfiguration.java | 203 + .../VpnClientConnectionHealth.java | 101 + .../v2019_02_01/VpnClientIPsecParameters.java | 60 + .../v2019_02_01/VpnClientParameters.java | 128 + .../v2019_02_01/VpnClientProtocol.java | 44 + .../VpnClientRevokedCertificate.java | 115 + .../v2019_02_01/VpnClientRootCertificate.java | 115 + .../network/v2019_02_01/VpnConnection.java | 496 +++ .../v2019_02_01/VpnConnectionStatus.java | 47 + .../network/v2019_02_01/VpnConnections.java | 53 + .../VpnDeviceScriptParameters.java | 95 + .../network/v2019_02_01/VpnGateway.java | 221 ++ .../VpnGatewayTunnelingProtocol.java | 41 + .../network/v2019_02_01/VpnGateways.java | 25 + .../v2019_02_01/VpnProfileResponse.java | 25 + .../network/v2019_02_01/VpnSite.java | 306 ++ .../network/v2019_02_01/VpnSiteId.java | 32 + .../network/v2019_02_01/VpnSites.java | 25 + .../v2019_02_01/VpnSitesConfigurations.java | 30 + .../network/v2019_02_01/VpnType.java | 41 + .../WebApplicationFirewallAction.java | 44 + .../WebApplicationFirewallCustomRule.java | 166 + .../WebApplicationFirewallEnabledState.java | 41 + .../WebApplicationFirewallMatchVariable.java | 59 + .../WebApplicationFirewallMode.java | 41 + .../WebApplicationFirewallOperator.java | 65 + .../WebApplicationFirewallPolicies.java | 25 + .../WebApplicationFirewallPolicy.java | 171 + ...pplicationFirewallPolicyResourceState.java | 53 + .../WebApplicationFirewallRuleType.java | 41 + .../WebApplicationFirewallTransform.java | 53 + ...icationGatewayAvailableSslOptionsImpl.java | 77 + ...cationGatewayAvailableSslOptionsInner.java | 159 + ...GatewayAvailableWafRuleSetsResultImpl.java | 33 + ...atewayAvailableWafRuleSetsResultInner.java | 45 + .../ApplicationGatewayBackendHealthImpl.java | 33 + .../ApplicationGatewayBackendHealthInner.java | 45 + ...ationGatewayBackendHealthOnDemandImpl.java | 38 + ...tionGatewayBackendHealthOnDemandInner.java | 71 + .../ApplicationGatewayImpl.java | 371 ++ .../ApplicationGatewayInner.java | 813 ++++ ...icationGatewaySslPredefinedPolicyImpl.java | 49 + ...cationGatewaySslPredefinedPolicyInner.java | 103 + .../ApplicationGatewaysImpl.java | 268 ++ .../ApplicationGatewaysInner.java | 2928 +++++++++++++++ .../ApplicationSecurityGroupImpl.java | 61 + .../ApplicationSecurityGroupInner.java | 96 + .../ApplicationSecurityGroupsImpl.java | 138 + .../ApplicationSecurityGroupsInner.java | 1273 +++++++ .../AvailableDelegationInner.java | 149 + .../AvailableDelegationsImpl.java | 53 + .../AvailableDelegationsInner.java | 293 ++ .../AvailableEndpointServicesImpl.java | 53 + .../AvailableEndpointServicesInner.java | 293 ++ .../AvailableProvidersListImpl.java | 33 + .../AvailableProvidersListInner.java | 45 + ...AvailableResourceGroupDelegationsImpl.java | 53 + ...vailableResourceGroupDelegationsInner.java | 301 ++ .../AzureFirewallFqdnTagImpl.java | 55 + .../AzureFirewallFqdnTagInner.java | 94 + .../AzureFirewallFqdnTagsImpl.java | 71 + .../AzureFirewallFqdnTagsInner.java | 285 ++ .../implementation/AzureFirewallImpl.java | 124 + .../implementation/AzureFirewallInner.java | 229 ++ .../implementation/AzureFirewallsImpl.java | 138 + .../implementation/AzureFirewallsInner.java | 948 +++++ .../AzureReachabilityReportImpl.java | 44 + .../AzureReachabilityReportInner.java | 99 + .../BackendAddressPoolImpl.java | 88 + .../BackendAddressPoolInner.java | 147 + .../BgpPeerStatusListResultImpl.java | 33 + .../BgpPeerStatusListResultInner.java | 45 + .../BgpServiceCommunitiesImpl.java | 71 + .../BgpServiceCommunitiesInner.java | 285 ++ .../BgpServiceCommunityImpl.java | 52 + .../BgpServiceCommunityInner.java | 102 + .../ConnectionMonitorInner.java | 179 + .../ConnectionMonitorQueryResultImpl.java | 39 + .../ConnectionMonitorQueryResultInner.java | 73 + .../ConnectionMonitorResultImpl.java | 206 ++ .../ConnectionMonitorResultInner.java | 234 ++ .../ConnectionMonitorsImpl.java | 106 + .../ConnectionMonitorsInner.java | 1134 ++++++ .../ConnectionResetSharedKeyImpl.java | 31 + .../ConnectionResetSharedKeyInner.java | 44 + .../ConnectionSharedKeyImpl.java | 36 + .../ConnectionSharedKeyInner.java | 44 + .../ConnectivityInformationImpl.java | 64 + .../ConnectivityInformationInner.java | 126 + .../DdosCustomPoliciesImpl.java | 88 + .../DdosCustomPoliciesInner.java | 810 ++++ .../implementation/DdosCustomPolicyImpl.java | 80 + .../implementation/DdosCustomPolicyInner.java | 141 + .../DdosProtectionPlanImpl.java | 68 + .../DdosProtectionPlanInner.java | 86 + .../DdosProtectionPlansImpl.java | 138 + .../DdosProtectionPlansInner.java | 1273 +++++++ .../DefaultSecurityRulesImpl.java | 65 + .../DefaultSecurityRulesInner.java | 397 ++ .../DnsNameAvailabilityResultInner.java | 43 + ...iveNetworkSecurityGroupListResultImpl.java | 38 + ...veNetworkSecurityGroupListResultInner.java | 60 + .../EffectiveRouteListResultImpl.java | 38 + .../EffectiveRouteListResultInner.java | 60 + .../EndpointServiceResultImpl.java | 45 + .../EndpointServiceResultInner.java | 48 + .../ExpressRouteCircuitAuthorizationImpl.java | 140 + ...ExpressRouteCircuitAuthorizationInner.java | 143 + ...ExpressRouteCircuitAuthorizationsImpl.java | 81 + ...xpressRouteCircuitAuthorizationsInner.java | 764 ++++ .../ExpressRouteCircuitConnectionImpl.java | 171 + .../ExpressRouteCircuitConnectionInner.java | 212 ++ .../ExpressRouteCircuitConnectionsImpl.java | 81 + .../ExpressRouteCircuitConnectionsInner.java | 807 ++++ .../ExpressRouteCircuitImpl.java | 230 ++ .../ExpressRouteCircuitInner.java | 453 +++ .../ExpressRouteCircuitPeeringImpl.java | 353 ++ .../ExpressRouteCircuitPeeringInner.java | 581 +++ .../ExpressRouteCircuitPeeringsImpl.java | 81 + .../ExpressRouteCircuitPeeringsInner.java | 764 ++++ .../ExpressRouteCircuitStatsImpl.java | 46 + .../ExpressRouteCircuitStatsInner.java | 121 + ...ssRouteCircuitsArpTableListResultImpl.java | 38 + ...sRouteCircuitsArpTableListResultInner.java | 71 + .../ExpressRouteCircuitsImpl.java | 202 + .../ExpressRouteCircuitsInner.java | 2025 ++++++++++ ...outeCircuitsRoutesTableListResultImpl.java | 38 + ...uteCircuitsRoutesTableListResultInner.java | 71 + ...cuitsRoutesTableSummaryListResultImpl.java | 38 + ...uitsRoutesTableSummaryListResultInner.java | 71 + .../ExpressRouteConnectionImpl.java | 147 + .../ExpressRouteConnectionInner.java | 153 + .../ExpressRouteConnectionListImpl.java | 32 + .../ExpressRouteConnectionListInner.java | 44 + .../ExpressRouteConnectionsImpl.java | 75 + .../ExpressRouteConnectionsInner.java | 606 +++ .../ExpressRouteCrossConnectionImpl.java | 148 + .../ExpressRouteCrossConnectionInner.java | 286 ++ ...xpressRouteCrossConnectionPeeringImpl.java | 251 ++ ...pressRouteCrossConnectionPeeringInner.java | 414 +++ ...pressRouteCrossConnectionPeeringsImpl.java | 81 + ...ressRouteCrossConnectionPeeringsInner.java | 764 ++++ .../ExpressRouteCrossConnectionsImpl.java | 140 + .../ExpressRouteCrossConnectionsInner.java | 1680 +++++++++ ...tionsRoutesTableSummaryListResultImpl.java | 38 + ...ionsRoutesTableSummaryListResultInner.java | 61 + .../ExpressRouteGatewayImpl.java | 101 + .../ExpressRouteGatewayInner.java | 161 + .../ExpressRouteGatewaysImpl.java | 138 + .../ExpressRouteGatewaysInner.java | 662 ++++ .../implementation/ExpressRouteLinkImpl.java | 95 + .../implementation/ExpressRouteLinkInner.java | 183 + .../implementation/ExpressRouteLinksImpl.java | 65 + .../ExpressRouteLinksInner.java | 397 ++ .../implementation/ExpressRoutePortImpl.java | 147 + .../implementation/ExpressRoutePortInner.java | 293 ++ .../implementation/ExpressRoutePortsImpl.java | 138 + .../ExpressRoutePortsInner.java | 1273 +++++++ .../ExpressRoutePortsLocationImpl.java | 62 + .../ExpressRoutePortsLocationInner.java | 123 + .../ExpressRoutePortsLocationsImpl.java | 83 + .../ExpressRoutePortsLocationsInner.java | 367 ++ .../ExpressRouteServiceProviderImpl.java | 57 + .../ExpressRouteServiceProviderInner.java | 128 + .../ExpressRouteServiceProvidersImpl.java | 71 + .../ExpressRouteServiceProvidersInner.java | 285 ++ .../FlowLogInformationImpl.java | 59 + .../FlowLogInformationInner.java | 180 + .../FrontendIPConfigurationImpl.java | 128 + .../FrontendIPConfigurationInner.java | 320 ++ .../GatewayRouteListResultImpl.java | 33 + .../GatewayRouteListResultInner.java | 45 + .../HubVirtualNetworkConnectionImpl.java | 85 + .../HubVirtualNetworkConnectionInner.java | 195 + .../HubVirtualNetworkConnectionsImpl.java | 65 + .../HubVirtualNetworkConnectionsInner.java | 397 ++ .../IPAddressAvailabilityResultImpl.java | 37 + .../IPAddressAvailabilityResultInner.java | 71 + .../implementation/IdParsingUtils.java | 57 + .../implementation/InboundNatRuleImpl.java | 213 ++ .../implementation/InboundNatRuleInner.java | 311 ++ .../implementation/InboundNatRulesImpl.java | 81 + .../implementation/InboundNatRulesInner.java | 853 +++++ .../implementation/InterfaceEndpointImpl.java | 121 + .../InterfaceEndpointInner.java | 204 + .../InterfaceEndpointsImpl.java | 138 + .../InterfaceEndpointsInner.java | 1030 ++++++ .../LoadBalancerBackendAddressPoolsImpl.java | 65 + .../LoadBalancerBackendAddressPoolsInner.java | 397 ++ ...dBalancerFrontendIPConfigurationsImpl.java | 65 + ...BalancerFrontendIPConfigurationsInner.java | 397 ++ .../implementation/LoadBalancerImpl.java | 213 ++ .../implementation/LoadBalancerInner.java | 351 ++ .../LoadBalancerLoadBalancingRulesImpl.java | 65 + .../LoadBalancerLoadBalancingRulesInner.java | 397 ++ .../LoadBalancerNetworkInterfaceImpl.java | 156 + .../LoadBalancerNetworkInterfacesImpl.java | 53 + .../LoadBalancerNetworkInterfacesInner.java | 301 ++ .../LoadBalancerOutboundRulesImpl.java | 65 + .../LoadBalancerOutboundRulesInner.java | 397 ++ .../LoadBalancerProbesImpl.java | 65 + .../LoadBalancerProbesInner.java | 397 ++ .../implementation/LoadBalancersImpl.java | 138 + .../implementation/LoadBalancersInner.java | 1355 +++++++ .../implementation/LoadBalancingRuleImpl.java | 121 + .../LoadBalancingRuleInner.java | 404 ++ .../LocalNetworkGatewayImpl.java | 108 + .../LocalNetworkGatewayInner.java | 196 + .../LocalNetworkGatewaysImpl.java | 114 + .../LocalNetworkGatewaysInner.java | 1048 ++++++ .../LocationAvailableDelegationImpl.java | 56 + .../LocationAvailableDelegationModelImpl.java | 56 + .../implementation/NatGatewayImpl.java | 131 + .../implementation/NatGatewayInner.java | 250 ++ .../implementation/NatGatewaysImpl.java | 138 + .../implementation/NatGatewaysInner.java | 1209 ++++++ ...rkConfigurationDiagnosticResponseImpl.java | 33 + ...kConfigurationDiagnosticResponseInner.java | 34 + .../NetworkInterfaceIPConfigurationInner.java | 394 ++ .../NetworkInterfaceIPConfigurationsImpl.java | 65 + ...NetworkInterfaceIPConfigurationsInner.java | 397 ++ .../implementation/NetworkInterfaceImpl.java | 212 ++ .../implementation/NetworkInterfaceInner.java | 384 ++ .../NetworkInterfaceLoadBalancerImpl.java | 157 + .../NetworkInterfaceLoadBalancersImpl.java | 53 + .../NetworkInterfaceLoadBalancersInner.java | 301 ++ ...ceNetworkInterfaceIPConfigurationImpl.java | 163 + .../NetworkInterfaceTapConfigurationImpl.java | 139 + ...NetworkInterfaceTapConfigurationInner.java | 130 + ...NetworkInterfaceTapConfigurationsImpl.java | 81 + ...etworkInterfaceTapConfigurationsInner.java | 764 ++++ .../implementation/NetworkInterfacesImpl.java | 221 ++ .../NetworkInterfacesInner.java | 2970 +++++++++++++++ .../NetworkManagementClientImpl.java | 1370 +++++++ .../implementation/NetworkManager.java | 939 +++++ .../implementation/NetworkProfileImpl.java | 92 + .../implementation/NetworkProfileInner.java | 159 + .../implementation/NetworkProfilesImpl.java | 138 + .../implementation/NetworkProfilesInner.java | 994 +++++ .../NetworkSecurityGroupImpl.java | 140 + .../NetworkSecurityGroupInner.java | 210 ++ .../NetworkSecurityGroupSecurityRuleImpl.java | 306 ++ ...orkSecurityGroupSecurityRuleModelImpl.java | 156 + .../NetworkSecurityGroupsImpl.java | 138 + .../NetworkSecurityGroupsInner.java | 1355 +++++++ .../implementation/NetworkWatcherImpl.java | 69 + .../implementation/NetworkWatcherInner.java | 102 + .../implementation/NetworkWatchersImpl.java | 300 ++ .../implementation/NetworkWatchersInner.java | 2814 ++++++++++++++ .../implementation/NextHopResultImpl.java | 42 + .../implementation/NextHopResultInner.java | 99 + .../implementation/OperationImpl.java | 48 + .../implementation/OperationInner.java | 125 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 281 ++ .../implementation/OutboundRuleImpl.java | 96 + .../implementation/OutboundRuleInner.java | 263 ++ .../implementation/P2SVpnGatewayImpl.java | 126 + .../implementation/P2SVpnGatewayInner.java | 242 ++ .../P2SVpnServerConfigurationImpl.java | 234 ++ .../P2SVpnServerConfigurationInner.java | 365 ++ .../implementation/P2sVpnGatewaysImpl.java | 151 + .../implementation/P2sVpnGatewaysInner.java | 1603 ++++++++ .../P2sVpnServerConfigurationsImpl.java | 81 + .../P2sVpnServerConfigurationsInner.java | 764 ++++ .../implementation/PacketCaptureInner.java | 178 + .../PacketCaptureQueryStatusResultImpl.java | 60 + .../PacketCaptureQueryStatusResultInner.java | 178 + .../PacketCaptureResultImpl.java | 190 + .../PacketCaptureResultInner.java | 262 ++ .../implementation/PacketCapturesImpl.java | 100 + .../implementation/PacketCapturesInner.java | 961 +++++ .../v2019_02_01/implementation/PageImpl.java | 75 + .../v2019_02_01/implementation/PageImpl1.java | 75 + ...PeerExpressRouteCircuitConnectionImpl.java | 97 + ...eerExpressRouteCircuitConnectionInner.java | 241 ++ ...eerExpressRouteCircuitConnectionsImpl.java | 65 + ...erExpressRouteCircuitConnectionsInner.java | 412 +++ .../v2019_02_01/implementation/ProbeImpl.java | 96 + .../implementation/ProbeInner.java | 261 ++ .../implementation/PublicIPAddressImpl.java | 203 + .../implementation/PublicIPAddressInner.java | 413 +++ .../implementation/PublicIPAddressesImpl.java | 186 + .../PublicIPAddressesInner.java | 2085 +++++++++++ .../implementation/PublicIPPrefixImpl.java | 161 + .../implementation/PublicIPPrefixInner.java | 315 ++ .../implementation/PublicIPPrefixesImpl.java | 138 + .../implementation/PublicIPPrefixesInner.java | 1355 +++++++ .../implementation/RouteFilterImpl.java | 123 + .../implementation/RouteFilterInner.java | 133 + .../implementation/RouteFilterRuleImpl.java | 183 + .../implementation/RouteFilterRuleInner.java | 194 + .../implementation/RouteFilterRulesImpl.java | 81 + .../implementation/RouteFilterRulesInner.java | 955 +++++ .../implementation/RouteFiltersImpl.java | 138 + .../implementation/RouteFiltersInner.java | 1207 ++++++ .../v2019_02_01/implementation/RouteImpl.java | 157 + .../implementation/RouteInner.java | 182 + .../implementation/RouteTableImpl.java | 111 + .../implementation/RouteTableInner.java | 171 + .../implementation/RouteTablesImpl.java | 138 + .../implementation/RouteTablesInner.java | 1355 +++++++ .../implementation/RoutesImpl.java | 81 + .../implementation/RoutesInner.java | 764 ++++ .../SecurityGroupViewResultImpl.java | 33 + .../SecurityGroupViewResultInner.java | 45 + .../implementation/SecurityRuleInner.java | 508 +++ .../implementation/SecurityRulesImpl.java | 81 + .../implementation/SecurityRulesInner.java | 764 ++++ .../ServiceEndpointPoliciesImpl.java | 138 + .../ServiceEndpointPoliciesInner.java | 1355 +++++++ .../ServiceEndpointPolicyDefinitionImpl.java | 151 + .../ServiceEndpointPolicyDefinitionInner.java | 168 + .../ServiceEndpointPolicyDefinitionsImpl.java | 81 + ...ServiceEndpointPolicyDefinitionsInner.java | 764 ++++ .../ServiceEndpointPolicyImpl.java | 99 + .../ServiceEndpointPolicyInner.java | 148 + .../implementation/SubnetImpl.java | 288 ++ .../implementation/SubnetInner.java | 428 +++ .../implementation/SubnetsImpl.java | 88 + .../implementation/SubnetsInner.java | 1047 ++++++ .../implementation/TopologyImpl.java | 49 + .../implementation/TopologyInner.java | 92 + .../TroubleshootingResultImpl.java | 49 + .../TroubleshootingResultInner.java | 124 + .../v2019_02_01/implementation/UsageImpl.java | 56 + .../implementation/UsageInner.java | 147 + .../implementation/UsagesImpl.java | 53 + .../implementation/UsagesInner.java | 293 ++ .../VerificationIPFlowResultImpl.java | 37 + .../VerificationIPFlowResultInner.java | 72 + .../implementation/VirtualHubImpl.java | 151 + .../implementation/VirtualHubInner.java | 277 ++ .../implementation/VirtualHubsImpl.java | 138 + .../implementation/VirtualHubsInner.java | 1274 +++++++ ...etNetworkInterfaceIPConfigurationImpl.java | 167 + .../VirtualNetworkGatewayConnectionImpl.java | 260 ++ .../VirtualNetworkGatewayConnectionInner.java | 526 +++ ...etworkGatewayConnectionListEntityImpl.java | 164 + ...tworkGatewayConnectionListEntityInner.java | 527 +++ .../VirtualNetworkGatewayConnectionsImpl.java | 152 + ...VirtualNetworkGatewayConnectionsInner.java | 1489 ++++++++ .../VirtualNetworkGatewayImpl.java | 192 + .../VirtualNetworkGatewayInner.java | 395 ++ .../VirtualNetworkGatewaysImpl.java | 250 ++ .../VirtualNetworkGatewaysInner.java | 3286 +++++++++++++++++ .../implementation/VirtualNetworkImpl.java | 175 + .../implementation/VirtualNetworkInner.java | 319 ++ .../VirtualNetworkPeeringImpl.java | 203 + .../VirtualNetworkPeeringInner.java | 295 ++ .../VirtualNetworkPeeringsImpl.java | 81 + .../VirtualNetworkPeeringsInner.java | 764 ++++ .../implementation/VirtualNetworkTapImpl.java | 126 + .../VirtualNetworkTapInner.java | 203 + .../VirtualNetworkTapsImpl.java | 138 + .../VirtualNetworkTapsInner.java | 1273 +++++++ .../VirtualNetworkUsageImpl.java | 56 + .../VirtualNetworkUsageInner.java | 93 + .../implementation/VirtualNetworksImpl.java | 174 + .../implementation/VirtualNetworksInner.java | 1690 +++++++++ .../implementation/VirtualWANImpl.java | 150 + .../implementation/VirtualWANInner.java | 282 ++ .../VirtualWanSecurityProvidersInner.java | 45 + .../implementation/VirtualWansImpl.java | 138 + .../implementation/VirtualWansInner.java | 1274 +++++++ .../VpnClientIPsecParametersImpl.java | 72 + .../VpnClientIPsecParametersInner.java | 242 ++ .../implementation/VpnConnectionImpl.java | 254 ++ .../implementation/VpnConnectionInner.java | 413 +++ .../implementation/VpnConnectionsImpl.java | 81 + .../implementation/VpnConnectionsInner.java | 764 ++++ .../implementation/VpnGatewayImpl.java | 118 + .../implementation/VpnGatewayInner.java | 199 + .../implementation/VpnGatewaysImpl.java | 138 + .../implementation/VpnGatewaysInner.java | 1274 +++++++ .../VpnProfileResponseImpl.java | 31 + .../VpnProfileResponseInner.java | 43 + .../implementation/VpnSiteImpl.java | 144 + .../implementation/VpnSiteInner.java | 278 ++ .../VpnSitesConfigurationsImpl.java | 35 + .../VpnSitesConfigurationsInner.java | 237 ++ .../implementation/VpnSitesImpl.java | 138 + .../implementation/VpnSitesInner.java | 1274 +++++++ .../WebApplicationFirewallPoliciesImpl.java | 138 + .../WebApplicationFirewallPoliciesInner.java | 869 +++++ .../WebApplicationFirewallPolicyImpl.java | 106 + .../WebApplicationFirewallPolicyInner.java | 178 + .../implementation/package-info.java | 11 + .../network/v2019_02_01/package-info.java | 11 + package.json | 3 + 832 files changed, 161223 insertions(+) create mode 100644 network/resource-manager/v2019_02_01/pom.xml create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Access.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AddressSpace.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAuthenticationCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAutoscaleConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableSslOptions.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableWafRuleSetsResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddress.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddressPool.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealth.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthHttpSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthOnDemand.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthPool.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServer.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServerHealth.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHttpSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayConnectionDraining.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCookieBasedAffinity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomError.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomErrorStatusCode.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallDisabledRuleGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallExclusion.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallMode.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleSet.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendPort.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHeaderConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHttpListener.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOnDemandProbe.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOperationalState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayPathRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbe.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbeHealthResponseMatch.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRuleType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleActionSet.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleCondition.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleSet.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCipherSuite.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPredefinedPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTier.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTrustedRootCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayUrlPathMap.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayWebApplicationFirewallConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroups.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AssociationType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthenticationMethod.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthorizationUseStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Availability.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableDelegations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableEndpointServices.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersList.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCountry.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableResourceGroupDelegations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureAsyncOperationResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewall.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleCollection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocolType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTag.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTags.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCAction.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCActionType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRuleCollection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleCollection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCAction.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCActionType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallThreatIntelMode.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewalls.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReport.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportItem.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLatencyInfo.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLocation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BGPCommunity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BackendAddressPool.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatusListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunities.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/CircuitConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorDestination.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorQueryResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSource.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSourceStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitors.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionResetSharedKey.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionSharedKey.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStateSnapshot.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityDestination.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityHop.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityInformation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityIssue.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivitySource.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Container.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterface.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceIpConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicies.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyTriggerSensitivityOverride.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlan.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlans.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettingsProtectionCoverage.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DefaultSecurityRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Delegation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DeviceProperties.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhcpOptions.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Dimension.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Direction.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupAssociation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRoute.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteSource.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveSecurityRuleProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointService.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointServiceResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Error.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorDetails.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorException.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponse.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponseException.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluatedNetworkSecurityGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluationState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuit.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitArpTable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorization.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorizations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeering.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringConfig.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringId.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeerings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitReference.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTableSummary.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitServiceProviderProperties.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuFamily.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuTier.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitStats.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuits.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsArpTableListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionId.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionList.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeering.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeerings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionRoutesTableSummary.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLink.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkAdminState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkConnectorType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinks.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePort.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePorts.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsEncapsulation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocationBandwidths.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProvider.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviderBandwidthsOffered.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviders.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogInformation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogStatusParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FrontendIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRoute.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRouteListResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GetVpnSitesConfigurationRequest.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPHeader.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPMethod.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAddressAvailabilityResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAllocationMethod.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfigurationProfile.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPVersion.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeEncryption.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeIntegrity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatPool.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoint.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoints.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpFlowProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpTag.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecEncryption.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecIntegrity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Ipv6ExpressRouteCircuitPeeringConfig.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IssueType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancer.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerBackendAddressPools.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerFrontendIPConfigurations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerLoadBalancingRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterface.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterfaces.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRuleProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerProbes.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancers.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancingRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadDistribution.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegationModel.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LogSpecification.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentityUserAssignedIdentitiesValue.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchCondition.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchVariable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchedRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MetricSpecification.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticProfile.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResponse.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicyConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterface.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceAssociation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceDnsSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceIPConfigurations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancer.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancers.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfigurations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaces.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkOperationStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfile.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfiles.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRuleModel.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroups.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityRulesEvaluationResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatcher.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatchers.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OfficeTrafficCategory.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationDisplay.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationPropertiesFormatServiceSpecification.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Origin.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OutboundRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnProfileParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusClientRootCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusServerRootCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRevokedCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRootCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnServerConfigurations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureFilter.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureQueryStatusResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureStorageLocation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptures.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilter.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilterRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcError.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PfsGroup.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PolicySettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PrepareNetworkPoliciesRequest.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Probe.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProbeProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProcessorArchitecture.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Protocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolCustomSettingsFormat.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProvisioningState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddress.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressDnsSettings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddresses.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefix.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixes.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/QueryTroubleshootingParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ReferencedPublicIpAddress.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceIdentityType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceNavigationLink.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RetentionPolicyParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Route.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilter.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteNextHopType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTables.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Routes.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupNetworkInterface.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAccess.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAssociations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleDirection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRules.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceAssociationLink.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicies.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinition.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinitions.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPropertiesFormat.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceProviderProvisioningState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Severity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnet.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SubnetAssociation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnets.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TagsObject.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Topology.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyAssociation.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyResource.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsConfigurationProperties.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsProperties.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TransportProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingDetails.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingRecommendedActions.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionHealth.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usage.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/UsageName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usages.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerbosityLevel.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowResult.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHub.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubId.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRoute.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRouteTable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubs.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetwork.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkConnectionGatewayReference.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionListEntity.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayIPConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySku.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuTier.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeering.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeeringState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeerings.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTap.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTaps.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsage.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsageName.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworks.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWAN.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProvider.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProviderType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWans.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConfiguration.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConnectionHealth.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientIPsecParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRevokedCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRootCertificate.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnection.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnectionStatus.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnections.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnDeviceScriptParameters.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateway.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGatewayTunnelingProtocol.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateways.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnProfileResponse.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSite.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSiteId.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSites.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSitesConfigurations.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallAction.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallCustomRule.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallEnabledState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMatchVariable.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMode.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallOperator.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicies.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicy.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicyResourceState.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallRuleType.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallTransform.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DnsNameAvailabilityResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IdParsingUtils.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfaceImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationModelImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancerImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManagementClientImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManager.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl1.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRuleInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWanSecurityProvidersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyImpl.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyInner.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/package-info.java create mode 100644 network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/package-info.java diff --git a/network/resource-manager/v2019_02_01/pom.xml b/network/resource-manager/v2019_02_01/pom.xml new file mode 100644 index 0000000000000..bce79f4532e17 --- /dev/null +++ b/network/resource-manager/v2019_02_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.network.v2019_02_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Access.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Access.java new file mode 100644 index 0000000000000..9b76cc8d16ac8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Access.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AddressSpace.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AddressSpace.java new file mode 100644 index 0000000000000..02462f7a30b99 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AddressSpace.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + */ +public class AddressSpace { + /** + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get a list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateway.java new file mode 100644 index 0000000000000..04ccbaededf15 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateway.java @@ -0,0 +1,858 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewayInner; + +/** + * Type representing ApplicationGateway. + */ +public interface ApplicationGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authenticationCertificates value. + */ + List authenticationCertificates(); + + /** + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the backendHttpSettingsCollection value. + */ + List backendHttpSettingsCollection(); + + /** + * @return the customErrorConfigurations value. + */ + List customErrorConfigurations(); + + /** + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the firewallPolicy value. + */ + SubResource firewallPolicy(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the frontendPorts value. + */ + List frontendPorts(); + + /** + * @return the gatewayIPConfigurations value. + */ + List gatewayIPConfigurations(); + + /** + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * @return the operationalState value. + */ + ApplicationGatewayOperationalState operationalState(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the rewriteRuleSets value. + */ + List rewriteRuleSets(); + + /** + * @return the sku value. + */ + ApplicationGatewaySku sku(); + + /** + * @return the sslCertificates value. + */ + List sslCertificates(); + + /** + * @return the sslPolicy value. + */ + ApplicationGatewaySslPolicy sslPolicy(); + + /** + * @return the trustedRootCertificates value. + */ + List trustedRootCertificates(); + + /** + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the ApplicationGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationgateway definition allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @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 AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next definition stage + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @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 backendHttpSettingsCollection. + * @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 CustomErrorConfigurations. + */ + interface WithCustomErrorConfigurations { + /** + * Specifies customErrorConfigurations. + * @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 EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @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 EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the applicationgateway definition allowing to specify FirewallPolicy. + */ + interface WithFirewallPolicy { + /** + * Specifies firewallPolicy. + * @param firewallPolicy Reference of the FirewallPolicy resource + * @return the next definition stage + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + + /** + * The stage of the applicationgateway definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @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 frontendPorts. + * @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 GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @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 HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @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 Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @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 Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway definition allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @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 RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway definition allowing to specify RewriteRuleSets. + */ + interface WithRewriteRuleSets { + /** + * Specifies rewriteRuleSets. + * @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 Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @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 SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @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 SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @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 TrustedRootCertificates. + */ + interface WithTrustedRootCertificates { + /** + * Specifies trustedRootCertificates. + * @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 UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @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 WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next definition stage + */ + WithCreate withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthenticationCertificates, DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithBackendHttpSettingsCollection, DefinitionStages.WithCustomErrorConfigurations, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFirewallPolicy, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithIdentity, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithRewriteRuleSets, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithTrustedRootCertificates, DefinitionStages.WithUrlPathMaps, DefinitionStages.WithWebApplicationFirewallConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a ApplicationGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthenticationCertificates, UpdateStages.WithAutoscaleConfiguration, UpdateStages.WithBackendAddressPools, UpdateStages.WithBackendHttpSettingsCollection, UpdateStages.WithCustomErrorConfigurations, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFirewallPolicy, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithIdentity, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithRewriteRuleSets, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithTrustedRootCertificates, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { + } + + /** + * Grouping of ApplicationGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationgateway update allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + * @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 update stage + */ + Update withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + * @param autoscaleConfiguration Autoscale Configuration + * @return the next update stage + */ + Update withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @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 update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + * @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 update stage + */ + Update withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway update allowing to specify CustomErrorConfigurations. + */ + interface WithCustomErrorConfigurations { + /** + * Specifies customErrorConfigurations. + * @param customErrorConfigurations Custom error configurations of the application gateway resource + * @return the next update stage + */ + Update withCustomErrorConfigurations(List customErrorConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + * @param enableFips Whether FIPS is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource + * @return the next update stage + */ + Update withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the applicationgateway update allowing to specify FirewallPolicy. + */ + interface WithFirewallPolicy { + /** + * Specifies firewallPolicy. + * @param firewallPolicy Reference of the FirewallPolicy resource + * @return the next update stage + */ + Update withFirewallPolicy(SubResource firewallPolicy); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @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 update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + * @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 update stage + */ + Update withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway update allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + * @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 update stage + */ + Update withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + * @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 update stage + */ + Update withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the application gateway, if configured + * @return the next update stage + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the applicationgateway update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Probes of the application gateway resource + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the applicationgateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway update allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + * @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 update stage + */ + Update withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + * @param requestRoutingRules Request routing rules of the application gateway resource + * @return the next update stage + */ + Update withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid Resource GUID property of the application gateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway update allowing to specify RewriteRuleSets. + */ + interface WithRewriteRuleSets { + /** + * Specifies rewriteRuleSets. + * @param rewriteRuleSets Rewrite rules for the application gateway resource + * @return the next update stage + */ + Update withRewriteRuleSets(List rewriteRuleSets); + } + + /** + * The stage of the applicationgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU of the application gateway resource + * @return the next update stage + */ + Update withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway update allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + * @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 update stage + */ + Update withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + * @param sslPolicy SSL policy of the application gateway resource + * @return the next update stage + */ + Update withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway update allowing to specify TrustedRootCertificates. + */ + interface WithTrustedRootCertificates { + /** + * Specifies trustedRootCertificates. + * @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 update stage + */ + Update withTrustedRootCertificates(List trustedRootCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + * @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 update stage + */ + Update withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + * @param webApplicationFirewallConfiguration Web application firewall configuration + * @return the next update stage + */ + Update withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting where the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAuthenticationCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 0000000000000..5e91415e050ae --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authentication certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayAuthenticationCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Provisioning state of the authentication certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the authentication certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAutoscaleConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAutoscaleConfiguration.java new file mode 100644 index 0000000000000..bd9ff4ce789ce --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAutoscaleConfiguration.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale configuration. + */ +public class ApplicationGatewayAutoscaleConfiguration { + /** + * Lower bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "minCapacity", required = true) + private int minCapacity; + + /** + * Upper bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "maxCapacity") + private Integer maxCapacity; + + /** + * Get lower bound on number of Application Gateway capacity. + * + * @return the minCapacity value + */ + public int minCapacity() { + return this.minCapacity; + } + + /** + * Set 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 upper bound on number of Application Gateway capacity. + * + * @return the maxCapacity value + */ + public Integer maxCapacity() { + return this.maxCapacity; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableSslOptions.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 0000000000000..6f2a8eed8f95e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableSslOptions.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing ApplicationGatewayAvailableSslOptions. + */ +public interface ApplicationGatewayAvailableSslOptions extends HasInner, HasManager { + /** + * @return the availableCipherSuites value. + */ + List availableCipherSuites(); + + /** + * @return the availableProtocols value. + */ + List availableProtocols(); + + /** + * @return the defaultPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the predefinedPolicies value. + */ + List predefinedPolicies(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableWafRuleSetsResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..8acd061114d46 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayAvailableWafRuleSetsResult. + */ +public interface ApplicationGatewayAvailableWafRuleSetsResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddress.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..018350bb5dd3b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddress.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backend address of an application gateway. + */ +public class ApplicationGatewayBackendAddress { + /** + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get fully qualified domain name (FQDN). + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set 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 iP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set iP address. + * + * @param ipAddress the ipAddress value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddressPool.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 0000000000000..54a31c2b27511 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Backend Address Pool of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendAddressPool extends SubResource { + /** + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations") + private List backendIPConfigurations; + + /** + * Backend addresses. + */ + @JsonProperty(value = "properties.backendAddresses") + private List backendAddresses; + + /** + * Provisioning state of the backend address pool resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get collection of references to IPs defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Set collection of references to IPs defined in network interfaces. + * + * @param backendIPConfigurations the backendIPConfigurations value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendIPConfigurations(List backendIPConfigurations) { + this.backendIPConfigurations = backendIPConfigurations; + return this; + } + + /** + * Get backend addresses. + * + * @return the backendAddresses value + */ + public List backendAddresses() { + return this.backendAddresses; + } + + /** + * Set backend addresses. + * + * @param backendAddresses the backendAddresses value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendAddresses(List backendAddresses) { + this.backendAddresses = backendAddresses; + return this; + } + + /** + * Get provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend address pool that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealth.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealth.java new file mode 100644 index 0000000000000..642d2cfa4544f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayBackendHealth. + */ +public interface ApplicationGatewayBackendHealth extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthHttpSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 0000000000000..925a255e89be8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealthHttp settings. + */ +public class ApplicationGatewayBackendHealthHttpSettings { + /** + * Reference of an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /** + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set reference of 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 list of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value + */ + public List servers() { + return this.servers; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthOnDemand.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthOnDemand.java new file mode 100644 index 0000000000000..d2ca118a42503 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthOnDemand.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewayBackendHealthOnDemandInner; + +/** + * Type representing ApplicationGatewayBackendHealthOnDemand. + */ +public interface ApplicationGatewayBackendHealthOnDemand extends HasInner, HasManager { + /** + * @return the backendAddressPool value. + */ + ApplicationGatewayBackendAddressPool backendAddressPool(); + + /** + * @return the backendHealthHttpSettings value. + */ + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthPool.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..75e850f1c6e8d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealth pool. + */ +public class ApplicationGatewayBackendHealthPool { + /** + * Reference of an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /** + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get reference of an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set reference of 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 list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServer.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..33df3b426f06e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway backendhealth http settings. + */ +public class ApplicationGatewayBackendHealthServer { + /** + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Reference of IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIPConfigurationInner ipConfiguration; + + /** + * Health of backend server. Possible values include: 'Unknown', 'Up', + * 'Down', 'Partial', 'Draining'. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /** + * Health Probe Log. + */ + @JsonProperty(value = "healthProbeLog") + private String healthProbeLog; + + /** + * Get iP address or FQDN of backend server. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set iP address or FQDN of backend server. + * + * @param address the address value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get reference of IP configuration of backend server. + * + * @return the ipConfiguration value + */ + public NetworkInterfaceIPConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set reference of IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withIpConfiguration(NetworkInterfaceIPConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @return the health value + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @param health the health value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + + /** + * Get health Probe Log. + * + * @return the healthProbeLog value + */ + public String healthProbeLog() { + return this.healthProbeLog; + } + + /** + * Set health Probe Log. + * + * @param healthProbeLog the healthProbeLog value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealthProbeLog(String healthProbeLog) { + this.healthProbeLog = healthProbeLog; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServerHealth.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..f588877beacaa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHealthServerHealth.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHttpSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 0000000000000..11cbf38f9c2d0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,470 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backend address pool settings of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendHttpSettings extends SubResource { + /** + * The destination port on the backend. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * The protocol used to communicate with the backend. Possible values + * include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /** + * Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "properties.requestTimeout") + private Integer requestTimeout; + + /** + * Probe resource of an application gateway. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Array of references to application gateway trusted root certificates. + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /** + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "properties.connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /** + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendAddress") + private Boolean pickHostNameFromBackendAddress; + + /** + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "properties.affinityCookieName") + private String affinityCookieName; + + /** + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "properties.probeEnabled") + private Boolean probeEnabled; + + /** + * Path which should be used as a prefix for all HTTP requests. Null means + * no path will be prefixed. Default value is null. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the destination port on the backend. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port on the backend. + * + * @param port the port value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol used to communicate with the backend. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used to communicate with the backend. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @return the cookieBasedAffinity value + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.cookieBasedAffinity; + } + + /** + * Set cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @param cookieBasedAffinity the cookieBasedAffinity value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { + this.cookieBasedAffinity = cookieBasedAffinity; + return this; + } + + /** + * Get 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 request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param requestTimeout the requestTimeout value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get probe resource of an application gateway. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set probe resource of an application gateway. + * + * @param probe the probe value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get array of references to application gateway authentication certificates. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set array of references to application gateway authentication certificates. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get array of references to application gateway trusted root certificates. + * + * @return the trustedRootCertificates value + */ + public List trustedRootCertificates() { + return this.trustedRootCertificates; + } + + /** + * Set array of references to application gateway trusted root certificates. + * + * @param trustedRootCertificates the trustedRootCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withTrustedRootCertificates(List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get connection draining of the backend http settings resource. + * + * @return the connectionDraining value + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.connectionDraining; + } + + /** + * Set connection draining of the backend http settings resource. + * + * @param connectionDraining the connectionDraining value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withConnectionDraining(ApplicationGatewayConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + /** + * Get host header to be sent to the backend servers. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host header to be sent to the backend servers. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get 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 whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @param pickHostNameFromBackendAddress the pickHostNameFromBackendAddress value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPickHostNameFromBackendAddress(Boolean pickHostNameFromBackendAddress) { + this.pickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + return this; + } + + /** + * Get cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value + */ + public String affinityCookieName() { + return this.affinityCookieName; + } + + /** + * Set cookie name to use for the affinity cookie. + * + * @param affinityCookieName the affinityCookieName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { + this.affinityCookieName = affinityCookieName; + return this; + } + + /** + * Get whether the probe is enabled. Default value is false. + * + * @return the probeEnabled value + */ + public Boolean probeEnabled() { + return this.probeEnabled; + } + + /** + * Set whether the probe is enabled. Default value is false. + * + * @param probeEnabled the probeEnabled value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { + this.probeEnabled = probeEnabled; + return this; + } + + /** + * Get 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 path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @param path the path value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPath(String path) { + this.path = path; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend http settings that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayConnectionDraining.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayConnectionDraining.java new file mode 100644 index 0000000000000..a3cbf55aa5705 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayConnectionDraining.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +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. + */ +public class ApplicationGatewayConnectionDraining { + /** + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get whether connection draining is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCookieBasedAffinity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 0000000000000..d55272879fd42 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCookieBasedAffinity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomError.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomError.java new file mode 100644 index 0000000000000..1561611e0f2f9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Customer error of an application gateway. + */ +public class ApplicationGatewayCustomError { + /** + * Status code of the application gateway customer error. Possible values + * include: 'HttpStatus403', 'HttpStatus502'. + */ + @JsonProperty(value = "statusCode") + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /** + * Error page URL of the application gateway customer error. + */ + @JsonProperty(value = "customErrorPageUrl") + private String customErrorPageUrl; + + /** + * Get status code of the application gateway customer error. Possible values include: 'HttpStatus403', 'HttpStatus502'. + * + * @return the statusCode value + */ + public ApplicationGatewayCustomErrorStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set status code of the application gateway customer error. Possible values include: 'HttpStatus403', 'HttpStatus502'. + * + * @param statusCode the statusCode value to set + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withStatusCode(ApplicationGatewayCustomErrorStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get error page URL of the application gateway customer error. + * + * @return the customErrorPageUrl value + */ + public String customErrorPageUrl() { + return this.customErrorPageUrl; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomErrorStatusCode.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomErrorStatusCode.java new file mode 100644 index 0000000000000..723485ca3261d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayCustomErrorStatusCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallDisabledRuleGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 0000000000000..35b1cfa7d8124 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allows to disable rules within a rule group or an entire rule group. + */ +public class ApplicationGatewayFirewallDisabledRuleGroup { + /** + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the name of the rule group that will be disabled. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallExclusion.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallExclusion.java new file mode 100644 index 0000000000000..8b6e6804102c4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allow to exclude some variable satisfy the condition for the WAF check. + */ +public class ApplicationGatewayFirewallExclusion { + /** + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private String matchVariable; + + /** + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private String selectorMatchOperator; + + /** + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the variable to be excluded. + * + * @return the matchVariable value + */ + public String matchVariable() { + return this.matchVariable; + } + + /** + * Set 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 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallMode.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallMode.java new file mode 100644 index 0000000000000..fdea4ac781e0e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRule.java new file mode 100644 index 0000000000000..3a03997f87e61 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRule.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule. + */ +public class ApplicationGatewayFirewallRule { + /** + * 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 identifier of the web application firewall rule. + * + * @return the ruleId value + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set 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 of the web application firewall rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..e8c45ab00c17e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule group. + */ +public class ApplicationGatewayFirewallRuleGroup { + /** + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the name of the web application firewall rule group. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set 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 of the web application firewall rule group. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 of the web application firewall rule group. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleSet.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 0000000000000..cbe4233093334 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFirewallRuleSet.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A web application firewall rule set. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayFirewallRuleSet extends Resource { + /** + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleGroups", required = true) + private List ruleGroups; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioning state of the web application firewall rule set. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the web application firewall rule set. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the type of the web application firewall rule set. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the web application firewall rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the rule groups of the web application firewall rule set. + * + * @return the ruleGroups value + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the rule groups of the web application firewall rule set. + * + * @param ruleGroups the ruleGroups value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendIPConfiguration.java new file mode 100644 index 0000000000000..6d4f16c941814 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendIPConfiguration.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendIPConfiguration extends SubResource { + /** + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP address allocation method. Possible values include: + * 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * Provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get privateIPAddress of the network interface IP Configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set privateIPAddress of the network interface IP Configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendPort.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendPort.java new file mode 100644 index 0000000000000..238ad29ec997b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayFrontendPort.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Frontend port of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendPort extends SubResource { + /** + * Frontend port. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Provisioning state of the frontend port resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend port. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set frontend port. + * + * @param port the port value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend port that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHeaderConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHeaderConfiguration.java new file mode 100644 index 0000000000000..926e9513fee48 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHeaderConfiguration.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Header configuration of the Actions set in Application Gateway. + */ +public class ApplicationGatewayHeaderConfiguration { + /** + * Header name of the header configuration. + */ + @JsonProperty(value = "headerName") + private String headerName; + + /** + * Header value of the header configuration. + */ + @JsonProperty(value = "headerValue") + private String headerValue; + + /** + * Get header name of the header configuration. + * + * @return the headerName value + */ + public String headerName() { + return this.headerName; + } + + /** + * Set 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 header value of the header configuration. + * + * @return the headerValue value + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHttpListener.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..7896b633aaddf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayHttpListener.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Http listener of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayHttpListener extends SubResource { + /** + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendPort") + private SubResource frontendPort; + + /** + * Protocol of the HTTP listener. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name of HTTP listener. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "properties.sslCertificate") + private SubResource sslCertificate; + + /** + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "properties.requireServerNameIndication") + private Boolean requireServerNameIndication; + + /** + * Provisioning state of the HTTP listener resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Custom error configurations of the HTTP listener. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend IP configuration resource of an application gateway. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set frontend IP configuration resource of an application gateway. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get frontend port resource of an application gateway. + * + * @return the frontendPort value + */ + public SubResource frontendPort() { + return this.frontendPort; + } + + /** + * Set frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get protocol of the HTTP listener. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol of the HTTP listener. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name of HTTP listener. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host name of HTTP listener. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get sSL certificate resource of an application gateway. + * + * @return the sslCertificate value + */ + public SubResource sslCertificate() { + return this.sslCertificate; + } + + /** + * Set sSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + /** + * Get applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @return the requireServerNameIndication value + */ + public Boolean requireServerNameIndication() { + return this.requireServerNameIndication; + } + + /** + * Set applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @param requireServerNameIndication the requireServerNameIndication value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { + this.requireServerNameIndication = requireServerNameIndication; + return this; + } + + /** + * Get provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get custom error configurations of the HTTP listener. + * + * @return the customErrorConfigurations value + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set custom error configurations of the HTTP listener. + * + * @param customErrorConfigurations the customErrorConfigurations value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withCustomErrorConfigurations(List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get name of the HTTP listener that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayIPConfiguration.java new file mode 100644 index 0000000000000..c748b734e1928 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayIPConfiguration.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + */ +@JsonFlatten +public class ApplicationGatewayIPConfiguration extends SubResource { + /** + * Reference of the subnet resource. A subnet from where application + * gateway gets its private address. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Provisioning state of the application gateway subnet resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOnDemandProbe.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOnDemandProbe.java new file mode 100644 index 0000000000000..9ab68288e9ea1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOnDemandProbe.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of on demand test probe request. + */ +public class ApplicationGatewayOnDemandProbe { + /** + * The protocol used for the probe. Possible values include: 'Http', + * 'Https'. + */ + @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 + * <Protocol>://<host>:<port><path>. + */ + @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; + + /** + * Name of backend pool of application gateway to which probe request will + * be sent. + */ + @JsonProperty(value = "backendPoolName") + private String backendPoolName; + + /** + * Name of backend http setting of application gateway to be used for test + * probe. + */ + @JsonProperty(value = "backendHttpSettingName") + private String backendHttpSettingName; + + /** + * Get the protocol used for the probe. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used for the probe. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name to send the probe to. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set 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 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 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 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 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 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 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 criterion for classifying a healthy probe response. + * + * @return the match value + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set 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 name of backend pool of application gateway to which probe request will be sent. + * + * @return the backendPoolName value + */ + public String backendPoolName() { + return this.backendPoolName; + } + + /** + * Set name of backend pool of application gateway to which probe request will be sent. + * + * @param backendPoolName the backendPoolName value to set + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendPoolName(String backendPoolName) { + this.backendPoolName = backendPoolName; + return this; + } + + /** + * Get name of backend http setting of application gateway to be used for test probe. + * + * @return the backendHttpSettingName value + */ + public String backendHttpSettingName() { + return this.backendHttpSettingName; + } + + /** + * Set name of backend http setting of application gateway to be used for test probe. + * + * @param backendHttpSettingName the backendHttpSettingName value to set + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendHttpSettingName(String backendHttpSettingName) { + this.backendHttpSettingName = backendHttpSettingName; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOperationalState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOperationalState.java new file mode 100644 index 0000000000000..12a908f4ddc82 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayOperationalState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayPathRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayPathRule.java new file mode 100644 index 0000000000000..ddde467403540 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayPathRule.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Path rule of URL path map of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayPathRule extends SubResource { + /** + * Path rules of URL path map. + */ + @JsonProperty(value = "properties.paths") + private List paths; + + /** + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Rewrite rule set resource of URL path map path rule. + */ + @JsonProperty(value = "properties.rewriteRuleSet") + private SubResource rewriteRuleSet; + + /** + * Path rule of URL path map resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get path rules of URL path map. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set path rules of URL path map. + * + * @param paths the paths value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get backend address pool resource of URL path map path rule. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of URL path map path rule. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of URL path map path rule. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of URL path map path rule. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get redirect configuration resource of URL path map path rule. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of URL path map path rule. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get rewrite rule set resource of URL path map path rule. + * + * @return the rewriteRuleSet value + */ + public SubResource rewriteRuleSet() { + return this.rewriteRuleSet; + } + + /** + * Set rewrite rule set resource of URL path map path rule. + * + * @param rewriteRuleSet the rewriteRuleSet value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRewriteRuleSet(SubResource rewriteRuleSet) { + this.rewriteRuleSet = rewriteRuleSet; + return this; + } + + /** + * Get path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the path rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbe.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbe.java new file mode 100644 index 0000000000000..0ca08f54b4c15 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbe.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Probe of the application gateway. + */ +@JsonFlatten +public class ApplicationGatewayProbe extends SubResource { + /** + * The protocol used for the probe. Possible values include: 'Http', + * 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name to send the probe to. + */ + @JsonProperty(value = "properties.host") + private String host; + + /** + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * The probing interval in seconds. This is the time interval between two + * consecutive probes. Acceptable values are from 1 second to 86400 + * seconds. + */ + @JsonProperty(value = "properties.interval") + private Integer interval; + + /** + * The probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The probe retry count. Backend server is marked down after consecutive + * probe failure count reaches UnhealthyThreshold. Acceptable values are + * from 1 second to 20. + */ + @JsonProperty(value = "properties.unhealthyThreshold") + private Integer unhealthyThreshold; + + /** + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendHttpSettings") + private Boolean pickHostNameFromBackendHttpSettings; + + /** + * Minimum number of servers that are always marked healthy. Default value + * is 0. + */ + @JsonProperty(value = "properties.minServers") + private Integer minServers; + + /** + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "properties.match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the protocol used for the probe. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used for the probe. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name to send the probe to. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set host name to send the probe to. + * + * @param host the host value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get 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 relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @param path the path value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the 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 probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @param interval the interval value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the 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 probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the 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 probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @param unhealthyThreshold the unhealthyThreshold value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + /** + * Get 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 whether the host header should be picked from the backend http settings. Default value is false. + * + * @param pickHostNameFromBackendHttpSettings the pickHostNameFromBackendHttpSettings value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostNameFromBackendHttpSettings(Boolean pickHostNameFromBackendHttpSettings) { + this.pickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + return this; + } + + /** + * Get minimum number of servers that are always marked healthy. Default value is 0. + * + * @return the minServers value + */ + public Integer minServers() { + return this.minServers; + } + + /** + * Set minimum number of servers that are always marked healthy. Default value is 0. + * + * @param minServers the minServers value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMinServers(Integer minServers) { + this.minServers = minServers; + return this; + } + + /** + * Get criterion for classifying a healthy probe response. + * + * @return the match value + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set criterion for classifying a healthy probe response. + * + * @param match the match value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the probe that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbeHealthResponseMatch.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbeHealthResponseMatch.java new file mode 100644 index 0000000000000..ed97e3ebd1be3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway probe health response match. + */ +public class ApplicationGatewayProbeHealthResponseMatch { + /** + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /** + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get body that must be contained in the health response. Default value is empty. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProtocol.java new file mode 100644 index 0000000000000..938e16291141f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 0000000000000..685f5b063cf24 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,309 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Redirect configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRedirectConfiguration extends SubResource { + /** + * HTTP redirection type. Possible values include: 'Permanent', 'Found', + * 'SeeOther', 'Temporary'. + */ + @JsonProperty(value = "properties.redirectType") + private ApplicationGatewayRedirectType redirectType; + + /** + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "properties.targetListener") + private SubResource targetListener; + + /** + * Url to redirect the request to. + */ + @JsonProperty(value = "properties.targetUrl") + private String targetUrl; + + /** + * Include path in the redirected url. + */ + @JsonProperty(value = "properties.includePath") + private Boolean includePath; + + /** + * Include query string in the redirected url. + */ + @JsonProperty(value = "properties.includeQueryString") + private Boolean includeQueryString; + + /** + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get hTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @return the redirectType value + */ + public ApplicationGatewayRedirectType redirectType() { + return this.redirectType; + } + + /** + * Set hTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @param redirectType the redirectType value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRedirectType(ApplicationGatewayRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get reference to a listener to redirect the request to. + * + * @return the targetListener value + */ + public SubResource targetListener() { + return this.targetListener; + } + + /** + * Set reference to a listener to redirect the request to. + * + * @param targetListener the targetListener value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetListener(SubResource targetListener) { + this.targetListener = targetListener; + return this; + } + + /** + * Get url to redirect the request to. + * + * @return the targetUrl value + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set url to redirect the request to. + * + * @param targetUrl the targetUrl value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get include path in the redirected url. + * + * @return the includePath value + */ + public Boolean includePath() { + return this.includePath; + } + + /** + * Set include path in the redirected url. + * + * @param includePath the includePath value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludePath(Boolean includePath) { + this.includePath = includePath; + return this; + } + + /** + * Get include query string in the redirected url. + * + * @return the includeQueryString value + */ + public Boolean includeQueryString() { + return this.includeQueryString; + } + + /** + * Set include query string in the redirected url. + * + * @param includeQueryString the includeQueryString value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludeQueryString(Boolean includeQueryString) { + this.includeQueryString = includeQueryString; + return this; + } + + /** + * Get request routing specifying redirect configuration. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing specifying redirect configuration. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set url path maps specifying default redirect configuration. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get path rules specifying redirect configuration. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rules specifying redirect configuration. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get name of the redirect configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectType.java new file mode 100644 index 0000000000000..3554970b62641 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRedirectType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 0000000000000..af9ef7526277c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request routing rule of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRequestRoutingRule extends SubResource { + /** + * Rule type. Possible values include: 'Basic', 'PathBasedRouting'. + */ + @JsonProperty(value = "properties.ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /** + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "properties.httpListener") + private SubResource httpListener; + + /** + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "properties.urlPathMap") + private SubResource urlPathMap; + + /** + * Rewrite Rule Set resource in Basic rule of the application gateway. + */ + @JsonProperty(value = "properties.rewriteRuleSet") + private SubResource rewriteRuleSet; + + /** + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Provisioning state of the request routing rule resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @return the ruleType value + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.ruleType; + } + + /** + * Set rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @param ruleType the ruleType value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get backend address pool resource of the application gateway. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of the application gateway. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get http listener resource of the application gateway. + * + * @return the httpListener value + */ + public SubResource httpListener() { + return this.httpListener; + } + + /** + * Set http listener resource of the application gateway. + * + * @param httpListener the httpListener value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withHttpListener(SubResource httpListener) { + this.httpListener = httpListener; + return this; + } + + /** + * Get uRL path map resource of the application gateway. + * + * @return the urlPathMap value + */ + public SubResource urlPathMap() { + return this.urlPathMap; + } + + /** + * Set uRL path map resource of the application gateway. + * + * @param urlPathMap the urlPathMap value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withUrlPathMap(SubResource urlPathMap) { + this.urlPathMap = urlPathMap; + return this; + } + + /** + * Get rewrite Rule Set resource in Basic rule of the application gateway. + * + * @return the rewriteRuleSet value + */ + public SubResource rewriteRuleSet() { + return this.rewriteRuleSet; + } + + /** + * Set rewrite Rule Set resource in Basic rule of the application gateway. + * + * @param rewriteRuleSet the rewriteRuleSet value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRewriteRuleSet(SubResource rewriteRuleSet) { + this.rewriteRuleSet = rewriteRuleSet; + return this; + } + + /** + * Get redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of the application gateway. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the request routing rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRuleType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRuleType.java new file mode 100644 index 0000000000000..09295c2d5cc12 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRequestRoutingRuleType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRule.java new file mode 100644 index 0000000000000..082ba06b272f3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRule.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Rewrite rule of an application gateway. + */ +public class ApplicationGatewayRewriteRule { + /** + * Name of the rewrite rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Rule Sequence of the rewrite rule that determines the order of execution + * of a particular rule in a RewriteRuleSet. + */ + @JsonProperty(value = "ruleSequence") + private Integer ruleSequence; + + /** + * Conditions based on which the action set execution will be evaluated. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /** + * Set of actions to be done as part of the rewrite Rule. + */ + @JsonProperty(value = "actionSet") + private ApplicationGatewayRewriteRuleActionSet actionSet; + + /** + * Get name of the rewrite rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 conditions based on which the action set execution will be evaluated. + * + * @return the conditions value + */ + public List conditions() { + return this.conditions; + } + + /** + * Set 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 set of actions to be done as part of the rewrite Rule. + * + * @return the actionSet value + */ + public ApplicationGatewayRewriteRuleActionSet actionSet() { + return this.actionSet; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleActionSet.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleActionSet.java new file mode 100644 index 0000000000000..3953fed8b3f6e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleActionSet.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Set of actions in the Rewrite Rule in Application Gateway. + */ +public class ApplicationGatewayRewriteRuleActionSet { + /** + * Request Header Actions in the Action Set. + */ + @JsonProperty(value = "requestHeaderConfigurations") + private List requestHeaderConfigurations; + + /** + * Response Header Actions in the Action Set. + */ + @JsonProperty(value = "responseHeaderConfigurations") + private List responseHeaderConfigurations; + + /** + * Get request Header Actions in the Action Set. + * + * @return the requestHeaderConfigurations value + */ + public List requestHeaderConfigurations() { + return this.requestHeaderConfigurations; + } + + /** + * Set 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 response Header Actions in the Action Set. + * + * @return the responseHeaderConfigurations value + */ + public List responseHeaderConfigurations() { + return this.responseHeaderConfigurations; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleCondition.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleCondition.java new file mode 100644 index 0000000000000..93f9e3d6a059d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleCondition.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Set of conditions in the Rewrite Rule in Application Gateway. + */ +public class ApplicationGatewayRewriteRuleCondition { + /** + * The condition parameter of the RewriteRuleCondition. + */ + @JsonProperty(value = "variable") + private String variable; + + /** + * The pattern, either fixed string or regular expression, that evaluates + * the truthfulness of the condition. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /** + * Setting this paramter 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 condition parameter of the RewriteRuleCondition. + * + * @return the variable value + */ + public String variable() { + return this.variable; + } + + /** + * Set 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, 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, 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 setting this paramter 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 setting this paramter 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleSet.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleSet.java new file mode 100644 index 0000000000000..2007126837ea0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayRewriteRuleSet.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Rewrite rule set of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRewriteRuleSet extends SubResource { + /** + * Rewrite rules in the rewrite rule set. + */ + @JsonProperty(value = "properties.rewriteRules") + private List rewriteRules; + + /** + * Provisioning state of the rewrite rule set resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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 rewrite rules in the rewrite rule set. + * + * @return the rewriteRules value + */ + public List rewriteRules() { + return this.rewriteRules; + } + + /** + * Set rewrite rules in the rewrite rule set. + * + * @param rewriteRules the rewriteRules value to set + * @return the ApplicationGatewayRewriteRuleSet object itself. + */ + public ApplicationGatewayRewriteRuleSet withRewriteRules(List rewriteRules) { + this.rewriteRules = rewriteRules; + return this; + } + + /** + * Get provisioning state of the rewrite rule set resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the rewrite rule set that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySku.java new file mode 100644 index 0000000000000..8032f2cece860 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySku.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of an application gateway. + */ +public class ApplicationGatewaySku { + /** + * Name of an application gateway SKU. Possible values include: + * 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + * 'WAF_Large', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /** + * Tier of an application gateway. Possible values include: 'Standard', + * 'WAF', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /** + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @return the name value + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @param name the name value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @return the tier value + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @param tier the tier value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get capacity (instance count) of an application gateway. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..de428b53567b1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySkuName.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCertificate.java new file mode 100644 index 0000000000000..1c5b55ac4363d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCertificate.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * SSL certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewaySslCertificate extends SubResource { + /** + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Password for the pfx file specified in data. Only applicable in PUT + * request. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * Base-64 encoded Public cert data corresponding to pfx specified in data. + * Only applicable in GET request. + */ + @JsonProperty(value = "properties.publicCertData") + private String publicCertData; + + /** + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "properties.keyVaultSecretId") + private String keyVaultSecretId; + + /** + * Provisioning state of the SSL certificate resource Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @param data the data value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get password for the pfx file specified in data. Only applicable in PUT request. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password for the pfx file specified in data. Only applicable in PUT request. + * + * @param password the password value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get 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; + } + + /** + * Set base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @param publicCertData the publicCertData value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get 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 secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the SSL certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCipherSuite.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCipherSuite.java new file mode 100644 index 0000000000000..d1c082dcd087f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicy.java new file mode 100644 index 0000000000000..f2de975d28c70 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway Ssl policy. + */ +public class ApplicationGatewaySslPolicy { + /** + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /** + * Type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /** + * Name of Ssl predefined policy. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S'. + */ + @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. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set 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 type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @return the policyType value + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @param policyType the policyType value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the policyName value + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param policyName the policyName value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set 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 minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyName.java new file mode 100644 index 0000000000000..2766218902f1d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyName.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyType.java new file mode 100644 index 0000000000000..92495cfd37407 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPolicyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPredefinedPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 0000000000000..8d176ed4be32b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** + * Type representing ApplicationGatewaySslPredefinedPolicy. + */ +public interface ApplicationGatewaySslPredefinedPolicy extends HasInner, HasManager { + /** + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslProtocol.java new file mode 100644 index 0000000000000..c04163e340e70 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewaySslProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTier.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTier.java new file mode 100644 index 0000000000000..7a1cee303ae4f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTrustedRootCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTrustedRootCertificate.java new file mode 100644 index 0000000000000..e7c0ef6871a95 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayTrustedRootCertificate.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Trusted Root certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayTrustedRootCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "properties.keyVaultSecretId") + private String keyVaultSecretId; + + /** + * Provisioning state of the trusted root certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get 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 secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get provisioning state of the trusted root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the trusted root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the trusted root certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayTrustedRootCertificate object itself. + */ + public ApplicationGatewayTrustedRootCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayUrlPathMap.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayUrlPathMap.java new file mode 100644 index 0000000000000..46d725d1a6fdf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayUrlPathMap.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + */ +@JsonFlatten +public class ApplicationGatewayUrlPathMap extends SubResource { + /** + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /** + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /** + * Default Rewrite rule set resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRewriteRuleSet") + private SubResource defaultRewriteRuleSet; + + /** + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /** + * Path rule of URL path map resource. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value + */ + public SubResource defaultBackendAddressPool() { + return this.defaultBackendAddressPool; + } + + /** + * Set default backend address pool resource of URL path map. + * + * @param defaultBackendAddressPool the defaultBackendAddressPool value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { + this.defaultBackendAddressPool = defaultBackendAddressPool; + return this; + } + + /** + * Get default backend http settings resource of URL path map. + * + * @return the defaultBackendHttpSettings value + */ + public SubResource defaultBackendHttpSettings() { + return this.defaultBackendHttpSettings; + } + + /** + * Set default backend http settings resource of URL path map. + * + * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { + this.defaultBackendHttpSettings = defaultBackendHttpSettings; + return this; + } + + /** + * Get default Rewrite rule set resource of URL path map. + * + * @return the defaultRewriteRuleSet value + */ + public SubResource defaultRewriteRuleSet() { + return this.defaultRewriteRuleSet; + } + + /** + * Set default Rewrite rule set resource of URL path map. + * + * @param defaultRewriteRuleSet the defaultRewriteRuleSet value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRewriteRuleSet(SubResource defaultRewriteRuleSet) { + this.defaultRewriteRuleSet = defaultRewriteRuleSet; + return this; + } + + /** + * Get default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value + */ + public SubResource defaultRedirectConfiguration() { + return this.defaultRedirectConfiguration; + } + + /** + * Set default redirect configuration resource of URL path map. + * + * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rule of URL path map resource. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the URL path map that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayWebApplicationFirewallConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 0000000000000..d9a75071a07d3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway web application firewall configuration. + */ +public class ApplicationGatewayWebApplicationFirewallConfiguration { + /** + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention'. + */ + @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 whether the web application firewall is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set 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 web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @return the firewallMode value + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @param firewallMode the firewallMode value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode(ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get 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 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 version of the rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set 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 disabled rule groups. + * + * @return the disabledRuleGroups value + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set 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 whether allow WAF to check request Body. + * + * @return the requestBodyCheck value + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set 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 maximum request body size for WAF. + * + * @return the maxRequestBodySize value + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set 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 maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set 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 maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set 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 exclusion list. + * + * @return the exclusions value + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateways.java new file mode 100644 index 0000000000000..28ba555e5e311 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationGateways.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationGateways. + */ +public interface ApplicationGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable startAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName); + + /** + * 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 + * @return the observable for the request + */ + Observable backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Lists all available server variables. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableServerVariablesAsync(); + + /** + * Lists all available request headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableRequestHeadersAsync(); + + /** + * Lists all available response headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableResponseHeadersAsync(); + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableWafRuleSetsAsync(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslOptionsAsync(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslPredefinedPoliciesAsync(); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSslPredefinedPolicyAsync(String predefinedPolicyName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..3806155155d65 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroup.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing ApplicationSecurityGroup. + */ +public interface ApplicationSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ApplicationSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a ApplicationSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ApplicationSecurityGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroups.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroups.java new file mode 100644 index 0000000000000..c42fd760b7137 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ApplicationSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationSecurityGroups. + */ +public interface ApplicationSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AssociationType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AssociationType.java new file mode 100644 index 0000000000000..2e4628767b2f5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AssociationType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthenticationMethod.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthenticationMethod.java new file mode 100644 index 0000000000000..93d4fbb1a329f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthenticationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthorizationUseStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthorizationUseStatus.java new file mode 100644 index 0000000000000..0401c5b0aabff --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AuthorizationUseStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Availability.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Availability.java new file mode 100644 index 0000000000000..f99fe57f148f0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Availability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Availability of the metric. + */ +public class Availability { + /** + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /** + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /** + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the time grain of the availability. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set 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 of the availability. + * + * @return the retention value + */ + public String retention() { + return this.retention; + } + + /** + * Set 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 duration of the availability blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableDelegations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableDelegations.java new file mode 100644 index 0000000000000..9c21a5f76022b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableDelegations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AvailableDelegationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailableDelegations. + */ +public interface AvailableDelegations extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableEndpointServices.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableEndpointServices.java new file mode 100644 index 0000000000000..026254456295b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableEndpointServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.EndpointServiceResult; + +/** + * Type representing 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 + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersList.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersList.java new file mode 100644 index 0000000000000..ba3aedc5e7cb2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersList.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AvailableProvidersListInner; +import java.util.List; + +/** + * Type representing AvailableProvidersList. + */ +public interface AvailableProvidersList extends HasInner, HasManager { + /** + * @return the countries value. + */ + List countries(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..4b45d656d2872 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCity.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * City or town details. + */ +public class AvailableProvidersListCity { + /** + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the city or town name. + * + * @return the cityName value + */ + public String cityName() { + return this.cityName; + } + + /** + * Set 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 a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCountry.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCountry.java new file mode 100644 index 0000000000000..40670692298ea --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListCountry.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Country details. + */ +public class AvailableProvidersListCountry { + /** + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the country name. + * + * @return the countryName value + */ + public String countryName() { + return this.countryName; + } + + /** + * Set 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 a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set 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 list of available states in the country. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListParameters.java new file mode 100644 index 0000000000000..d9659c61a7d9b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Constraints that determine the list of available Internet service providers. + */ +public class AvailableProvidersListParameters { + /** + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /** + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get a list of Azure regions. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set 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 for available providers list. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set 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 for available providers list. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set 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 or town for available providers list. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListState.java new file mode 100644 index 0000000000000..36b1e5690fe92 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableProvidersListState.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * State details. + */ +public class AvailableProvidersListState { + /** + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the state name. + * + * @return the stateName value + */ + public String stateName() { + return this.stateName; + } + + /** + * Set 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 a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set 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 list of available cities or towns in the state. + * + * @return the cities value + */ + public List cities() { + return this.cities; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableResourceGroupDelegations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableResourceGroupDelegations.java new file mode 100644 index 0000000000000..2954fbd4d7800 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AvailableResourceGroupDelegations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.LocationAvailableDelegationModel; + +/** + * Type representing 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 + * @return the observable for the request + */ + Observable listAsync(final String location, final String resourceGroupName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureAsyncOperationResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureAsyncOperationResult.java new file mode 100644 index 0000000000000..71cdc5131a438 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureAsyncOperationResult.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Status of the Azure async operation. Possible values are: 'InProgress', + * 'Succeeded', and 'Failed'. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private NetworkOperationStatus status; + + /** + * Details of the error occurred during specified asynchronous operation. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public NetworkOperationStatus status() { + return this.status; + } + + /** + * Set status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withStatus(NetworkOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get details of the error occurred during specified asynchronous operation. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set details of the error occurred during specified asynchronous operation. + * + * @param error the error value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewall.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewall.java new file mode 100644 index 0000000000000..607c459ae8764 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewall.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AzureFirewallInner; + +/** + * Type representing AzureFirewall. + */ +public interface AzureFirewall extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationRuleCollections value. + */ + List applicationRuleCollections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the natRuleCollections value. + */ + List natRuleCollections(); + + /** + * @return the networkRuleCollections value. + */ + List networkRuleCollections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the threatIntelMode value. + */ + AzureFirewallThreatIntelMode threatIntelMode(); + + /** + * The entirety of the AzureFirewall definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of AzureFirewall definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AzureFirewall definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the AzureFirewall definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the azurefirewall definition allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @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 IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @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 NatRuleCollections. + */ + interface WithNatRuleCollections { + /** + * Specifies natRuleCollections. + * @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 networkRuleCollections. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the azurefirewall definition allowing to specify ThreatIntelMode. + */ + interface WithThreatIntelMode { + /** + * Specifies threatIntelMode. + * @param threatIntelMode The operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' + * @return the next definition stage + */ + WithCreate withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApplicationRuleCollections, DefinitionStages.WithIpConfigurations, DefinitionStages.WithNatRuleCollections, DefinitionStages.WithNetworkRuleCollections, DefinitionStages.WithProvisioningState, DefinitionStages.WithThreatIntelMode { + } + } + /** + * The template for a AzureFirewall update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApplicationRuleCollections, UpdateStages.WithIpConfigurations, UpdateStages.WithNatRuleCollections, UpdateStages.WithNetworkRuleCollections, UpdateStages.WithProvisioningState, UpdateStages.WithThreatIntelMode { + } + + /** + * Grouping of AzureFirewall update stages. + */ + interface UpdateStages { + /** + * The stage of the azurefirewall update allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall + * @return the next update stage + */ + Update withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configuration of the Azure Firewall resource + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall update allowing to specify NatRuleCollections. + */ + interface WithNatRuleCollections { + /** + * Specifies natRuleCollections. + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall + * @return the next update stage + */ + Update withNatRuleCollections(List natRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall + * @return the next update stage + */ + Update withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the azurefirewall update allowing to specify ThreatIntelMode. + */ + interface WithThreatIntelMode { + /** + * Specifies threatIntelMode. + * @param threatIntelMode The operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off' + * @return the next update stage + */ + Update withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRule.java new file mode 100644 index 0000000000000..8201ec1bd81d6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of an application rule. + */ +public class AzureFirewallApplicationRule { + /** + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /** + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /** + * Get name of the application rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set 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 array of ApplicationRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set 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 list of FQDNs for this rule. + * + * @return the targetFqdns value + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set 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 list of FQDN Tags for this rule. + * + * @return the fqdnTags value + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleCollection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 0000000000000..89960603f2c96 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Application rule collection resource. + */ +@JsonFlatten +public class AzureFirewallApplicationRuleCollection extends SubResource { + /** + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the application rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the application rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a application rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a application rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocol.java new file mode 100644 index 0000000000000..5d59ffe70513c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocol.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the application rule protocol. + */ +public class AzureFirewallApplicationRuleProtocol { + /** + * Protocol type. Possible values include: 'Http', 'Https'. + */ + @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 protocol type. Possible values include: 'Http', 'Https'. + * + * @return the protocolType value + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set protocol type. Possible values include: 'Http', 'Https'. + * + * @param protocolType the protocolType value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType(AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocolType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 0000000000000..ac26478037561 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallApplicationRuleProtocolType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTag.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTag.java new file mode 100644 index 0000000000000..b317ba7adbe0d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTag.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AzureFirewallFqdnTagInner; + +/** + * Type representing AzureFirewallFqdnTag. + */ +public interface AzureFirewallFqdnTag extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the fqdnTagName value. + */ + String fqdnTagName(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTags.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTags.java new file mode 100644 index 0000000000000..1bbdb4643314b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallFqdnTags.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AzureFirewallFqdnTagsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewallFqdnTags. + */ +public interface AzureFirewallFqdnTags extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallIPConfiguration.java new file mode 100644 index 0000000000000..9a43218ddaea1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallIPConfiguration.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an Azure Firewall. + */ +@JsonFlatten +public class AzureFirewallIPConfiguration extends SubResource { + /** + * The Firewall Internal Load Balancer IP to be used as the next hop in + * User Defined Routes. + */ + @JsonProperty(value = "properties.privateIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIPAddress; + + /** + * Reference of the subnet resource. This resource must be named + * 'AzureFirewallSubnet'. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. This field is a mandatory input if + * subnet is not null. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * 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 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 reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @param subnet the subnet value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of 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 reference of the PublicIP resource. This field is a mandatory input if subnet is not null. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCAction.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCAction.java new file mode 100644 index 0000000000000..2509f3ab0cafe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCAction.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AzureFirewall NAT Rule Collection Action. + */ +public class AzureFirewallNatRCAction { + /** + * The type of action. Possible values include: 'Snat', 'Dnat'. + */ + @JsonProperty(value = "type") + private AzureFirewallNatRCActionType type; + + /** + * Get the type of action. Possible values include: 'Snat', 'Dnat'. + * + * @return the type value + */ + public AzureFirewallNatRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Snat', 'Dnat'. + * + * @param type the type value to set + * @return the AzureFirewallNatRCAction object itself. + */ + public AzureFirewallNatRCAction withType(AzureFirewallNatRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCActionType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCActionType.java new file mode 100644 index 0000000000000..72483265e61d6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRCActionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRule.java new file mode 100644 index 0000000000000..147fa6acdfee7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRule.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of a NAT rule. + */ +public class AzureFirewallNatRule { + /** + * Name of the NAT rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /** + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /** + * Get name of the NAT rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set 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 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 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 list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set 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 array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set 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 translated address for this NAT rule. + * + * @return the translatedAddress value + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set 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 translated port for this NAT rule. + * + * @return the translatedPort value + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRuleCollection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRuleCollection.java new file mode 100644 index 0000000000000..903ee963c63f1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNatRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * NAT rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNatRuleCollection extends SubResource { + /** + * Priority of the NAT rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a NAT rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallNatRCAction action; + + /** + * Collection of rules used by a NAT rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the NAT rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the NAT rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a NAT rule collection. + * + * @return the action value + */ + public AzureFirewallNatRCAction action() { + return this.action; + } + + /** + * Set the action type of a NAT rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withAction(AzureFirewallNatRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a NAT rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a NAT rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 AzureFirewallNatRuleCollection object itself. + */ + public AzureFirewallNatRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRule.java new file mode 100644 index 0000000000000..5af3557710223 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the network rule. + */ +public class AzureFirewallNetworkRule { + /** + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Get name of the network rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set 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 list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set 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 list of destination IP addresses. + * + * @return the destinationAddresses value + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set 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 list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleCollection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 0000000000000..d909696a30d6c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNetworkRuleCollection extends SubResource { + /** + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the network rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the network rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a network rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a network rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleProtocol.java new file mode 100644 index 0000000000000..cf65990d25c6f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallNetworkRuleProtocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCAction.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCAction.java new file mode 100644 index 0000000000000..e0706267375c5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCAction.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the AzureFirewallRCAction. + */ +public class AzureFirewallRCAction { + /** + * The type of action. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type of action. Possible values include: 'Allow', 'Deny'. + * + * @return the type value + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Allow', 'Deny'. + * + * @param type the type value to set + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCActionType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCActionType.java new file mode 100644 index 0000000000000..637b43edc66fc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallRCActionType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallThreatIntelMode.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallThreatIntelMode.java new file mode 100644 index 0000000000000..53b75ecd5d600 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewallThreatIntelMode.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewalls.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewalls.java new file mode 100644 index 0000000000000..f17b4797b6127 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureFirewalls.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AzureFirewallsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewalls. + */ +public interface AzureFirewalls extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReport.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReport.java new file mode 100644 index 0000000000000..bdd416cec8a1d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReport.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AzureReachabilityReportInner; +import java.util.List; + +/** + * Type representing AzureReachabilityReport. + */ +public interface AzureReachabilityReport extends HasInner, HasManager { + /** + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * @return the reachabilityReport value. + */ + List reachabilityReport(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportItem.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportItem.java new file mode 100644 index 0000000000000..030b56841be10 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportItem.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details for a given provider location. + */ +public class AzureReachabilityReportItem { + /** + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /** + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the Internet service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 Azure region. + * + * @return the azureLocation value + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set 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 list of latency details for each of the time series. + * + * @return the latencies value + */ + public List latencies() { + return this.latencies; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLatencyInfo.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 0000000000000..5bff624217d52 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details on latency for a time series. + */ +public class AzureReachabilityReportLatencyInfo { + /** + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private DateTime timeStamp; + + /** + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the time stamp. + * + * @return the timeStamp value + */ + public DateTime timeStamp() { + return this.timeStamp; + } + + /** + * Set the time stamp. + * + * @param timeStamp the timeStamp value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimeStamp(DateTime timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLocation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLocation.java new file mode 100644 index 0000000000000..aa957c137cee2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportLocation.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a geographic location. + */ +public class AzureReachabilityReportLocation { + /** + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the name of the country. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set 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 name of the state. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set 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 name of the city or town. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportParameters.java new file mode 100644 index 0000000000000..10c02f9020fc2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/AzureReachabilityReportParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Geographic and time constraints for Azure reachability report. + */ +public class AzureReachabilityReportParameters { + /** + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private DateTime endTime; + + /** + * Get parameters that define a geographic location. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set 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 list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set 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 optional Azure regions to scope the query to. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set 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 start time for the Azure reachability report. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the Azure reachability report. + * + * @param startTime the startTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time for the Azure reachability report. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time for the Azure reachability report. + * + * @param endTime the endTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BGPCommunity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BGPCommunity.java new file mode 100644 index 0000000000000..7718a30786974 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BGPCommunity.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bgp community information offered in Service Community resources. + */ +public class BGPCommunity { + /** + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /** + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /** + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /** + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /** + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get 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 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 name of the bgp community. e.g. Skype. + * + * @return the communityName value + */ + public String communityName() { + return this.communityName; + } + + /** + * Set 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 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 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 prefixes that the bgp community contains. + * + * @return the communityPrefixes value + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set 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 customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set 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 service group of the bgp community contains. + * + * @return the serviceGroup value + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BackendAddressPool.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BackendAddressPool.java new file mode 100644 index 0000000000000..fcaa34177213b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BackendAddressPool.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing BackendAddressPool. + */ +public interface BackendAddressPool extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendIPConfigurations value. + */ + List backendIPConfigurations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRule value. + */ + SubResource outboundRule(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerState.java new file mode 100644 index 0000000000000..4e89e9393e70d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatus.java new file mode 100644 index 0000000000000..6d945c11dcf61 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatus.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP peer status details. + */ +public class BgpPeerStatus { + /** + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /** + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Integer asn; + + /** + * The BGP peer state. Possible values include: 'Unknown', 'Stopped', + * 'Idle', 'Connecting', 'Connected'. + */ + @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 virtual network gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the remote BGP peer. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the autonomous system number of the remote BGP peer. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Get the BGP peer state. Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected'. + * + * @return the state value + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get for how long the peering has been up. + * + * @return the connectedDuration value + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the number of routes learned from this peer. + * + * @return the routesReceived value + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the number of BGP messages sent. + * + * @return the messagesSent value + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the number of BGP messages received. + * + * @return the messagesReceived value + */ + public Long messagesReceived() { + return this.messagesReceived; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatusListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..fa72b9ee5cd29 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpPeerStatusListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.BgpPeerStatusListResultInner; +import java.util.List; + +/** + * Type representing BgpPeerStatusListResult. + */ +public interface BgpPeerStatusListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunities.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunities.java new file mode 100644 index 0000000000000..ea427657042c9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunities.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.BgpServiceCommunitiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BgpServiceCommunities. + */ +public interface BgpServiceCommunities extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunity.java new file mode 100644 index 0000000000000..92fa932bb84aa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpServiceCommunity.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.BgpServiceCommunityInner; + +/** + * Type representing BgpServiceCommunity. + */ +public interface BgpServiceCommunity extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bgpCommunities value. + */ + List bgpCommunities(); + + /** + * @return the serviceName value. + */ + String serviceName(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpSettings.java new file mode 100644 index 0000000000000..eb2a606ad739f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/BgpSettings.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP settings details. + */ +public class BgpSettings { + /** + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /** + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /** + * Get the BGP speaker's ASN. + * + * @return the asn value + */ + public Long asn() { + return this.asn; + } + + /** + * Set 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 BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set 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 weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/CircuitConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..3593d6a55e4a9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/CircuitConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorDestination.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorDestination.java new file mode 100644 index 0000000000000..256d6f2271681 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorDestination.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the destination of connection monitor. + */ +public class ConnectionMonitorDestination { + /** + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /** + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set 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 address of the connection monitor destination (IP or domain name). + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set 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 destination port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorParameters.java new file mode 100644 index 0000000000000..3e697132b44d6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the operation to create a connection monitor. + */ +public class ConnectionMonitorParameters { + /** + * Describes the source of connection monitor. + */ + @JsonProperty(value = "source", required = true) + private ConnectionMonitorSource source; + + /** + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "destination", required = true) + 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; + + /** + * Get describes the source of connection monitor. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set 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 describes the destination of connection monitor. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set 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 determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set 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 monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorQueryResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorQueryResult.java new file mode 100644 index 0000000000000..005d1fd3b89cc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorQueryResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** + * Type representing ConnectionMonitorQueryResult. + */ +public interface ConnectionMonitorQueryResult extends HasInner, HasManager { + /** + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * @return the states value. + */ + List states(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorResult.java new file mode 100644 index 0000000000000..a9ca9d980eff4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorResult.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionMonitorResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing ConnectionMonitorResult. + */ +public interface ConnectionMonitorResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoStart value. + */ + Boolean autoStart(); + + /** + * @return the destination value. + */ + ConnectionMonitorDestination destination(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monitoringIntervalInSeconds value. + */ + Integer monitoringIntervalInSeconds(); + + /** + * @return the monitoringStatus value. + */ + String monitoringStatus(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the source value. + */ + ConnectionMonitorSource source(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ConnectionMonitorResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithDestination, DefinitionStages.WithSource, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConnectionMonitorResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConnectionMonitorResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * 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 + */ + WithDestination withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Describes the destination of connection monitor + * @return the next definition stage + */ + WithSource withDestination(ConnectionMonitorDestination destination); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @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 AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @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 Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next definition stage + */ + WithCreate withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoStart, DefinitionStages.WithLocation, DefinitionStages.WithMonitoringIntervalInSeconds, DefinitionStages.WithTags { + } + } + /** + * The template for a ConnectionMonitorResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoStart, UpdateStages.WithLocation, UpdateStages.WithMonitoringIntervalInSeconds, UpdateStages.WithTags { + } + + /** + * Grouping of ConnectionMonitorResult update stages. + */ + interface UpdateStages { + /** + * The stage of the connectionmonitorresult update allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + * @param autoStart Determines if the connection monitor will start automatically once created + * @return the next update stage + */ + Update withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Connection monitor location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + * @param monitoringIntervalInSeconds Monitoring interval in seconds + * @return the next update stage + */ + Update withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Connection monitor tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSource.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSource.java new file mode 100644 index 0000000000000..b6263d213342f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSource.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the source of connection monitor. + */ +public class ConnectionMonitorSource { + /** + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the source by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set 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 source port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSourceStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSourceStatus.java new file mode 100644 index 0000000000000..986083160ae40 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitorSourceStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitors.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitors.java new file mode 100644 index 0000000000000..3428e0e629a1e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionMonitors.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionMonitorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConnectionMonitors. + */ +public interface ConnectionMonitors extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable queryAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionResetSharedKey.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionResetSharedKey.java new file mode 100644 index 0000000000000..1cce1ae0007bb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionResetSharedKey.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionResetSharedKeyInner; + +/** + * Type representing ConnectionResetSharedKey. + */ +public interface ConnectionResetSharedKey extends HasInner, HasManager { + /** + * @return the keyLength value. + */ + int keyLength(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionSharedKey.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionSharedKey.java new file mode 100644 index 0000000000000..631c37d5b6f99 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionSharedKey.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionSharedKeyInner; + +/** + * Type representing ConnectionSharedKey. + */ +public interface ConnectionSharedKey extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionState.java new file mode 100644 index 0000000000000..c76e5db495c38 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStateSnapshot.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStateSnapshot.java new file mode 100644 index 0000000000000..c675daeab1e0b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStateSnapshot.java @@ -0,0 +1,270 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection state snapshot. + */ +public class ConnectionStateSnapshot { + /** + * The connection state. Possible values include: 'Reachable', + * 'Unreachable', 'Unknown'. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /** + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Connectivity analysis evaluation state. Possible values include: + * 'NotStarted', 'InProgress', 'Completed'. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /** + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Integer avgLatencyInMs; + + /** + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Integer minLatencyInMs; + + /** + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Integer maxLatencyInMs; + + /** + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Integer probesSent; + + /** + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Integer probesFailed; + + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @return the connectionState value + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @param connectionState the connectionState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the start time of the connection snapshot. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the connection snapshot. + * + * @param startTime the startTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the connection snapshot. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the connection snapshot. + * + * @param endTime the endTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @return the evaluationState value + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @param evaluationState the evaluationState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get average latency in ms. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Integer avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get minimum latency in ms. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Integer minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get maximum latency in ms. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Integer maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the number of sent probes. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Set the number of sent probes. + * + * @param probesSent the probesSent value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Integer probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Set the number of failed probes. + * + * @param probesFailed the probesFailed value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Integer probesFailed) { + this.probesFailed = probesFailed; + return this; + } + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStatus.java new file mode 100644 index 0000000000000..6bc089c636137 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityDestination.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityDestination.java new file mode 100644 index 0000000000000..28f32937f327e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityDestination.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define destination of connection. + */ +public class ConnectivityDestination { + /** + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get 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 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 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 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 port on which check connectivity will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityHop.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityHop.java new file mode 100644 index 0000000000000..30ede327f0c4f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityHop.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a hop between the source and the destination. + */ +public class ConnectivityHop { + /** + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /** + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type of the hop. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the ID of the hop. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the IP address of the hop. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get the ID of the resource corresponding to this hop. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get list of next hop identifiers. + * + * @return the nextHopIds value + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get list of issues. + * + * @return the issues value + */ + public List issues() { + return this.issues; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityInformation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityInformation.java new file mode 100644 index 0000000000000..288ff61fe1a65 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityInformation.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectivityInformationInner; +import java.util.List; + +/** + * Type representing ConnectivityInformation. + */ +public interface ConnectivityInformation extends HasInner, HasManager { + /** + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * @return the hops value. + */ + List hops(); + + /** + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * @return the probesSent value. + */ + Integer probesSent(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityIssue.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityIssue.java new file mode 100644 index 0000000000000..7c8a2aebd746e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityIssue.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an issue encountered in the process of checking for + * connectivity. + */ +public class ConnectivityIssue { + /** + * The origin of the issue. Possible values include: 'Local', 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /** + * The severity of the issue. Possible values include: 'Error', 'Warning'. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /** + * The type of issue. Possible values include: 'Unknown', 'AgentStopped', + * 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', + * 'UserDefinedRoute', 'PortThrottled', 'Platform'. + */ + @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 of the issue. Possible values include: 'Local', 'Inbound', 'Outbound'. + * + * @return the origin value + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity of the issue. Possible values include: 'Error', 'Warning'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type of issue. Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform'. + * + * @return the type value + */ + public IssueType type() { + return this.type; + } + + /** + * Get provides additional context on the issue. + * + * @return the context value + */ + public List> context() { + return this.context; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityParameters.java new file mode 100644 index 0000000000000..3a57a17fd8d97 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivityParameters.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that determine how the connectivity check will be performed. + */ +public class ConnectivityParameters { + /** + * Describes the source of the connection. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /** + * Describes the destination of connection. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /** + * Network protocol. Possible values include: 'Tcp', 'Http', 'Https', + * 'Icmp'. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /** + * Configuration of the protocol. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /** + * Get describes the source of the connection. + * + * @return the source value + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set describes 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 describes the destination of connection. + * + * @return the destination value + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set describes 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 network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @return the protocol value + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @param protocol the protocol value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get configuration of the protocol. + * + * @return the protocolConfiguration value + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivitySource.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivitySource.java new file mode 100644 index 0000000000000..2e6e421c31342 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ConnectivitySource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source of the connection. + */ +public class ConnectivitySource { + /** + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get 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 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 source port from which a connectivity check will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Container.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Container.java new file mode 100644 index 0000000000000..5b5b27bdf2097 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Container.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; + +/** + * Reference to container resource in remote resource provider. + */ +public class Container extends SubResource { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterface.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterface.java new file mode 100644 index 0000000000000..d68b1d5bfe554 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterface.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Container network interface child resource. + */ +@JsonFlatten +public class ContainerNetworkInterface extends SubResource { + /** + * Container network interface configuration from which this container + * network interface is created. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfiguration") + private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; + + /** + * Reference to the container to which this container network interface is + * attached. + */ + @JsonProperty(value = "properties.container") + private Container container; + + /** + * Reference to the ip configuration on this container nic. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get container network interface configuration from which this container network interface is created. + * + * @return the containerNetworkInterfaceConfiguration value + */ + public ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration() { + return this.containerNetworkInterfaceConfiguration; + } + + /** + * Set container network interface configuration from which this container network interface is created. + * + * @param containerNetworkInterfaceConfiguration the containerNetworkInterfaceConfiguration value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withContainerNetworkInterfaceConfiguration(ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration) { + this.containerNetworkInterfaceConfiguration = containerNetworkInterfaceConfiguration; + return this; + } + + /** + * Get reference to the container to which this container network interface is attached. + * + * @return the container value + */ + public Container container() { + return this.container; + } + + /** + * Set reference to the container to which this container network interface is attached. + * + * @param container the container value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withContainer(Container container) { + this.container = container; + return this; + } + + /** + * Get reference to the ip configuration on this container nic. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set reference to the ip configuration on this container nic. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterface object itself. + */ + public ContainerNetworkInterface withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..f88bfd093f2e0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceConfiguration.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Container network interface configuration child resource. + */ +@JsonFlatten +public class ContainerNetworkInterfaceConfiguration extends SubResource { + /** + * A list of ip configurations of the container network interface + * configuration. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * A list of container network interfaces created from this container + * network interface configuration. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get a list of ip configurations of the container network interface configuration. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of ip configurations of the container network interface configuration. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get a list of container network interfaces created from this container network interface configuration. + * + * @return the containerNetworkInterfaces value + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Set a list of container network interfaces created from this container network interface configuration. + * + * @param containerNetworkInterfaces the containerNetworkInterfaces value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.containerNetworkInterfaces = containerNetworkInterfaces; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterfaceConfiguration object itself. + */ + public ContainerNetworkInterfaceConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceIpConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..a473fea90f795 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ContainerNetworkInterfaceIpConfiguration.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The ip configuration for a container network interface. + */ +@JsonFlatten +public class ContainerNetworkInterfaceIpConfiguration { + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ContainerNetworkInterfaceIpConfiguration object itself. + */ + public ContainerNetworkInterfaceIpConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicies.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicies.java new file mode 100644 index 0000000000000..7b8cc248e231c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicies.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.DdosCustomPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DdosCustomPolicies. + */ +public interface DdosCustomPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicy.java new file mode 100644 index 0000000000000..a4bb4eeb272bc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicy.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.DdosCustomPolicyInner; + +/** + * Type representing DdosCustomPolicy. + */ +public interface DdosCustomPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the protocolCustomSettings value. + */ + List protocolCustomSettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddresses value. + */ + List publicIPAddresses(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the DdosCustomPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DdosCustomPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DdosCustomPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DdosCustomPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the ddoscustompolicy definition allowing to specify ProtocolCustomSettings. + */ + interface WithProtocolCustomSettings { + /** + * Specifies protocolCustomSettings. + * @param protocolCustomSettings The protocol-specific DDoS policy customization parameters + * @return the next definition stage + */ + WithCreate withProtocolCustomSettings(List protocolCustomSettings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProtocolCustomSettings { + } + } + /** + * The template for a DdosCustomPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProtocolCustomSettings { + } + + /** + * Grouping of DdosCustomPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the ddoscustompolicy update allowing to specify ProtocolCustomSettings. + */ + interface WithProtocolCustomSettings { + /** + * Specifies protocolCustomSettings. + * @param protocolCustomSettings The protocol-specific DDoS policy customization parameters + * @return the next update stage + */ + Update withProtocolCustomSettings(List protocolCustomSettings); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyProtocol.java new file mode 100644 index 0000000000000..57249e5457a23 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyTriggerSensitivityOverride.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyTriggerSensitivityOverride.java new file mode 100644 index 0000000000000..992e5ffd7aa0d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosCustomPolicyTriggerSensitivityOverride.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlan.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlan.java new file mode 100644 index 0000000000000..a07ab00d1152d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlan.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.DdosProtectionPlanInner; + +/** + * Type representing DdosProtectionPlan. + */ +public interface DdosProtectionPlan extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * The entirety of the DdosProtectionPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DdosProtectionPlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DdosProtectionPlan definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DdosProtectionPlan definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a DdosProtectionPlan update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of DdosProtectionPlan update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlans.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlans.java new file mode 100644 index 0000000000000..6e2b7b10684bf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosProtectionPlans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.DdosProtectionPlansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DdosProtectionPlans. + */ +public interface DdosProtectionPlans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettings.java new file mode 100644 index 0000000000000..69b580a72c6bf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettings.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the DDoS protection settings of the public IP. + */ +public class DdosSettings { + /** + * 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. Possible + * values include: 'Basic', 'Standard'. + */ + @JsonProperty(value = "protectionCoverage") + private DdosSettingsProtectionCoverage protectionCoverage; + + /** + * Get the DDoS custom policy associated with the public IP. + * + * @return the ddosCustomPolicy value + */ + public SubResource ddosCustomPolicy() { + return this.ddosCustomPolicy; + } + + /** + * Set 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 DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized. Possible values include: 'Basic', 'Standard'. + * + * @return the protectionCoverage value + */ + public DdosSettingsProtectionCoverage protectionCoverage() { + return this.protectionCoverage; + } + + /** + * Set the DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized. Possible values include: 'Basic', 'Standard'. + * + * @param protectionCoverage the protectionCoverage value to set + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectionCoverage(DdosSettingsProtectionCoverage protectionCoverage) { + this.protectionCoverage = protectionCoverage; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettingsProtectionCoverage.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettingsProtectionCoverage.java new file mode 100644 index 0000000000000..334263537ab51 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DdosSettingsProtectionCoverage.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DefaultSecurityRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DefaultSecurityRules.java new file mode 100644 index 0000000000000..7cb40bca2dbad --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DefaultSecurityRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.DefaultSecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DefaultSecurityRules. + */ +public interface DefaultSecurityRules extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Delegation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Delegation.java new file mode 100644 index 0000000000000..31352812302ee --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Delegation.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Details the service to which the subnet is delegated. + */ +@JsonFlatten +public class Delegation extends SubResource { + /** + * The name of the service to whom the subnet should be delegated (e.g. + * Microsoft.Sql/servers). + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Describes the actions permitted to the service upon delegation. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get 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 name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + * + * @param serviceName the serviceName value to set + * @return the Delegation object itself. + */ + public Delegation withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get describes the actions permitted to the service upon delegation. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set describes the actions permitted to the service upon delegation. + * + * @param actions the actions value to set + * @return the Delegation object itself. + */ + public Delegation withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the Delegation object itself. + */ + public Delegation withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DeviceProperties.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DeviceProperties.java new file mode 100644 index 0000000000000..d1019c0e81649 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DeviceProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of properties of the device. + */ +public class DeviceProperties { + /** + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /** + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /** + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get name of the device Vendor. + * + * @return the deviceVendor value + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set 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 model of the device. + * + * @return the deviceModel value + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set 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 link speed. + * + * @return the linkSpeedInMbps value + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhGroup.java new file mode 100644 index 0000000000000..6e9e88e5d608a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhGroup.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhcpOptions.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhcpOptions.java new file mode 100644 index 0000000000000..b03959773e030 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/DhcpOptions.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class DhcpOptions { + /** + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the list of DNS servers IP addresses. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Dimension.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Dimension.java new file mode 100644 index 0000000000000..43c0a50004a1f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Dimension.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of the metric. + */ +public class Dimension { + /** + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 internal name of the dimension. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Direction.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Direction.java new file mode 100644 index 0000000000000..8bd263065a601 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Direction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroup.java new file mode 100644 index 0000000000000..e5984d1f8ba63 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security group. + */ +public class EffectiveNetworkSecurityGroup { + /** + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /** + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /** + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private Map> tagMap; + + /** + * Get the ID of network security group that is applied. + * + * @return the networkSecurityGroup value + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set 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 associated resources. + * + * @return the association value + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set 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 a collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set 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 mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value + */ + public Map> tagMap() { + return this.tagMap; + } + + /** + * Set 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(Map> tagMap) { + this.tagMap = tagMap; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupAssociation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 0000000000000..e1530efde7a35 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The effective network security group association. + */ +public class EffectiveNetworkSecurityGroupAssociation { + /** + * 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 ID of the subnet if assigned. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set 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 ID of the network interface if assigned. + * + * @return the networkInterface value + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..be804dae8e094 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** + * Type representing EffectiveNetworkSecurityGroupListResult. + */ +public interface EffectiveNetworkSecurityGroupListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..f550327034847 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveNetworkSecurityRule.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security rules. + */ +public class EffectiveNetworkSecurityRule { + /** + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /** + * The network protocol this rule applies to. Possible values are: 'Tcp', + * 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + */ + @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. Possible values include: + * 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /** + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * The direction of the rule. Possible values include: 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get 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 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 network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set 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 destination port or range. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set 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 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 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 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 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 source address prefix. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set 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 destination address prefix. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set 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 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 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 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 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 expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set 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 expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set 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 whether network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set whether network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @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 of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set 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 of the rule. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRoute.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRoute.java new file mode 100644 index 0000000000000..c5616e004afa6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRoute.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective Route. + */ +public class EffectiveRoute { + /** + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /** + * If true, on-premises routes are not propagated to the network interfaces + * in the subnet. + */ + @JsonProperty(value = "disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /** + * Who created the route. Possible values are: 'Unknown', 'User', + * 'VirtualNetworkGateway', and 'Default'. Possible values include: + * 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /** + * The value of effective route. Possible values are: 'Active' and + * 'Invalid'. Possible values include: 'Active', 'Invalid'. + */ + @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. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name of the user defined route. This is optional. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @return the source value + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @param source the source value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @return the state value + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @param state the state value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set 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 IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set 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 type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..90b853e147680 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.EffectiveRouteListResultInner; +import java.util.List; + +/** + * Type representing EffectiveRouteListResult. + */ +public interface EffectiveRouteListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteSource.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteSource.java new file mode 100644 index 0000000000000..b9ef84a0f2982 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteSource.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteState.java new file mode 100644 index 0000000000000..b2dc20c5c48be --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveRouteState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveSecurityRuleProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..75be4b0968693 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EffectiveSecurityRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointService.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointService.java new file mode 100644 index 0000000000000..3198399ac5f9d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointService.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identifies the service being brought into the virtual network. + */ +public class EndpointService { + /** + * A unique identifier of the service being referenced by the interface + * endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique identifier of the service being referenced by the interface endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set a unique identifier of the service being referenced by the interface endpoint. + * + * @param id the id value to set + * @return the EndpointService object itself. + */ + public EndpointService withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointServiceResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointServiceResult.java new file mode 100644 index 0000000000000..4bde67800dff2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EndpointServiceResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.EndpointServiceResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing EndpointServiceResult. + */ +public interface EndpointServiceResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Error.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Error.java new file mode 100644 index 0000000000000..4c18c8431cb2b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Error.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common error representation. + */ +public class Error { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Error target. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Inner error message. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set error target. + * + * @param target the target value to set + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set error details. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get inner error message. + * + * @return the innerError value + */ + public String innerError() { + return this.innerError; + } + + /** + * Set inner error message. + * + * @param innerError the innerError value to set + * @return the Error object itself. + */ + public Error withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorDetails.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorDetails.java new file mode 100644 index 0000000000000..847bd6faf0134 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorDetails.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common error details representation. + */ +public class ErrorDetails { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error target. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set error target. + * + * @param target the target value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorException.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorException.java new file mode 100644 index 0000000000000..15e5829c48e0e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * 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(final String message, final Response 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 body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponse.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponse.java new file mode 100644 index 0000000000000..bf815c967f375 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponse.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponse { + /** + * Error. + * The error details object. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the error details object. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the error details object. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponseException.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponseException.java new file mode 100644 index 0000000000000..e1114cb70e29b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluatedNetworkSecurityGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..baa986d52d7b3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network security group evaluation. + */ +public class EvaluatedNetworkSecurityGroup { + /** + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /** + * Resource ID of nic or subnet to which network security group is applied. + */ + @JsonProperty(value = "appliedTo") + private String appliedTo; + + /** + * Matched network security rule. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /** + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get network security group ID. + * + * @return the networkSecurityGroupId value + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set 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 resource ID of nic or subnet to which network security group is applied. + * + * @return the appliedTo value + */ + public String appliedTo() { + return this.appliedTo; + } + + /** + * Set 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 matched network security rule. + * + * @return the matchedRule value + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set 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 list of network security rules evaluation results. + * + * @return the rulesEvaluationResult value + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluationState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluationState.java new file mode 100644 index 0000000000000..552c0dda040d5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/EvaluationState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuit.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuit.java new file mode 100644 index 0000000000000..3642c72b2cf0a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuit.java @@ -0,0 +1,488 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitInner; + +/** + * Type representing ExpressRouteCircuit. + */ +public interface ExpressRouteCircuit extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowClassicOperations value. + */ + Boolean allowClassicOperations(); + + /** + * @return the authorizations value. + */ + List authorizations(); + + /** + * @return the bandwidthInGbps value. + */ + Double bandwidthInGbps(); + + /** + * @return the circuitProvisioningState value. + */ + String circuitProvisioningState(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRoutePort value. + */ + SubResource expressRoutePort(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the globalReachEnabled value. + */ + Boolean globalReachEnabled(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProperties value. + */ + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sku value. + */ + ExpressRouteCircuitSku sku(); + + /** + * @return the stag value. + */ + Integer stag(); + + /** + * The entirety of the ExpressRouteCircuit definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuit definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuit definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCircuit definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecircuit definition allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next definition stage + */ + WithCreate withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies 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 BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withBandwidthInGbps(Double bandwidthInGbps); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @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 ExpressRoutePort. + */ + interface WithExpressRoutePort { + /** + * Specifies expressRoutePort. + * @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 GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @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 globalReachEnabled. + * @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 Peerings. + */ + interface WithPeerings { + /** + * Specifies 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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies 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 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 serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next definition stage + */ + WithCreate withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next definition stage + */ + WithCreate withSku(ExpressRouteCircuitSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowClassicOperations, DefinitionStages.WithAuthorizations, DefinitionStages.WithBandwidthInGbps, DefinitionStages.WithCircuitProvisioningState, DefinitionStages.WithExpressRoutePort, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithGlobalReachEnabled, DefinitionStages.WithPeerings, DefinitionStages.WithProvisioningState, DefinitionStages.WithServiceKey, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProperties, DefinitionStages.WithServiceProviderProvisioningState, DefinitionStages.WithSku { + } + } + /** + * The template for a ExpressRouteCircuit update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowClassicOperations, UpdateStages.WithAuthorizations, UpdateStages.WithBandwidthInGbps, UpdateStages.WithCircuitProvisioningState, UpdateStages.WithExpressRoutePort, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithGlobalReachEnabled, UpdateStages.WithPeerings, UpdateStages.WithProvisioningState, UpdateStages.WithServiceKey, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProperties, UpdateStages.WithServiceProviderProvisioningState, UpdateStages.WithSku { + } + + /** + * Grouping of ExpressRouteCircuit update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuit update allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + * @param allowClassicOperations Allow classic operations + * @return the next update stage + */ + Update withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + * @param authorizations The list of authorizations + * @return the next update stage + */ + Update withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource + * @return the next update stage + */ + Update withBandwidthInGbps(Double bandwidthInGbps); + } + + /** + * The stage of the expressroutecircuit update allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + * @param circuitProvisioningState The CircuitProvisioningState state of the resource + * @return the next update stage + */ + Update withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ExpressRoutePort. + */ + interface WithExpressRoutePort { + /** + * Specifies expressRoutePort. + * @param expressRoutePort The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource + * @return the next update stage + */ + Update withExpressRoutePort(SubResource expressRoutePort); + } + + /** + * The stage of the expressroutecircuit update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit update allowing to specify GlobalReachEnabled. + */ + interface WithGlobalReachEnabled { + /** + * Specifies globalReachEnabled. + * @param globalReachEnabled Flag denoting Global reach status + * @return the next update stage + */ + Update withGlobalReachEnabled(Boolean globalReachEnabled); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + * @param serviceKey The ServiceKey + * @return the next update stage + */ + Update withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes The ServiceProviderNotes + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + * @param serviceProviderProperties The ServiceProviderProperties + * @return the next update stage + */ + Update withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU + * @return the next update stage + */ + Update withSku(ExpressRouteCircuitSku sku); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitArpTable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitArpTable.java new file mode 100644 index 0000000000000..56ba9b0b9ba13 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitArpTable.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ARP table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitArpTable { + /** + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /** + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /** + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get entry age in minutes. + * + * @return the age value + */ + public Integer age() { + return this.age; + } + + /** + * Set 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 interface address. + * + * @return the interfaceProperty value + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set 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 IP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set 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 MAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorization.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorization.java new file mode 100644 index 0000000000000..a85dabec6b9bd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCircuitAuthorization. + */ +public interface ExpressRouteCircuitAuthorization extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitAuthorization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitAuthorization definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * 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 allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @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 authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next definition stage + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets 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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithAuthorizationUseStatus, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a ExpressRouteCircuitAuthorization update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + * @param authorizationUseStatus AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' + * @return the next update stage + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorizations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 0000000000000..1192985499115 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitAuthorizations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitAuthorizationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitAuthorizations. + */ +public interface ExpressRouteCircuitAuthorizations extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..5304622e7dab2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnection.java @@ -0,0 +1,288 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing ExpressRouteCircuitConnection. + */ +public interface ExpressRouteCircuitConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPeering, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitConnection definition. + */ + interface Blank extends WithPeering { + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Peering. + */ + interface WithPeering { + /** + * 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 allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @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 authorizationKey. + * @param authorizationKey The authorization key + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify CircuitConnectionStatus. + */ + interface WithCircuitConnectionStatus { + /** + * Specifies circuitConnectionStatus. + * @param circuitConnectionStatus Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + * @return the next definition stage + */ + WithCreate withCircuitConnectionStatus(CircuitConnectionStatus circuitConnectionStatus); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @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 Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets 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 PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithCircuitConnectionStatus, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeerExpressRouteCircuitPeering { + } + } + /** + * The template for a ExpressRouteCircuitConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAuthorizationKey, UpdateStages.WithCircuitConnectionStatus, UpdateStages.WithExpressRouteCircuitPeering, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeerExpressRouteCircuitPeering { + } + + /** + * Grouping of ExpressRouteCircuitConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitconnection update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorization key + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify CircuitConnectionStatus. + */ + interface WithCircuitConnectionStatus { + /** + * Specifies circuitConnectionStatus. + * @param circuitConnectionStatus Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + * @return the next update stage + */ + Update withCircuitConnectionStatus(CircuitConnectionStatus circuitConnectionStatus); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection + * @return the next update stage + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the peered circuit + * @return the next update stage + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..e3b415cd24ffa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitConnections.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitConnections. + */ +public interface ExpressRouteCircuitConnections extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName, final String peeringName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeering.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeering.java new file mode 100644 index 0000000000000..5f6ef4bdd4e0d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeering.java @@ -0,0 +1,696 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitPeering. + */ +public interface ExpressRouteCircuitPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteConnection value. + */ + ExpressRouteConnectionId expressRouteConnection(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeredConnections value. + */ + List peeredConnections(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilter value. + */ + RouteFilter routeFilter(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCircuitPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitPeering definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * 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 allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next definition stage + */ + WithCreate withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next definition stage + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteConnection. + */ + interface WithExpressRouteConnection { + /** + * Specifies expressRouteConnection. + * @param expressRouteConnection The ExpressRoute connection + * @return the next definition stage + */ + WithCreate withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets 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 PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next definition stage + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next definition stage + */ + WithCreate withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next definition stage + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next definition stage + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAzureASN, DefinitionStages.WithConnections, DefinitionStages.WithExpressRouteConnection, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryAzurePort, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteFilter, DefinitionStages.WithSecondaryAzurePort, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithStats, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCircuitPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureASN, UpdateStages.WithConnections, UpdateStages.WithExpressRouteConnection, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryAzurePort, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithProvisioningState, UpdateStages.WithRouteFilter, UpdateStages.WithSecondaryAzurePort, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithStats, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCircuitPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitpeering update allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + * @param azureASN The Azure ASN + * @return the next update stage + */ + Update withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections The list of circuit connections associated with Azure Private Peering for this circuit + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ExpressRouteConnection. + */ + interface WithExpressRouteConnection { + /** + * Specifies expressRouteConnection. + * @param expressRouteConnection The ExpressRoute connection + * @return the next update stage + */ + Update withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + * @param primaryAzurePort The primary port + * @return the next update stage + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + * @param routeFilter The reference of the RouteFilter resource + * @return the next update stage + */ + Update withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + * @param secondaryAzurePort The secondary port + * @return the next update stage + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + * @param stats Gets peering stats + * @return the next update stage + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 0000000000000..41aaf359c549d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..ec6c503d5dda5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the peering configuration. + */ +public class ExpressRouteCircuitPeeringConfig { + /** + * The reference of AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /** + * The communities of bgp peering. Specified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /** + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded'. + */ + @JsonProperty(value = "advertisedPublicPrefixesState") + 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 reference of AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the reference of 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 communities of bgp peering. Specified for microsoft peering. + * + * @return the advertisedCommunities value + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set 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 advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @return the advertisedPublicPrefixesState value + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Set advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @param advertisedPublicPrefixesState the advertisedPublicPrefixesState value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixesState(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState) { + this.advertisedPublicPrefixesState = advertisedPublicPrefixesState; + return this; + } + + /** + * Get the legacy mode of the peering. + * + * @return the legacyMode value + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set 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 of the peering. + * + * @return the customerASN value + */ + public Integer customerASN() { + return this.customerASN; + } + + /** + * Set 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 of the configuration. + * + * @return the routingRegistryName value + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringId.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringId.java new file mode 100644 index 0000000000000..6649fba914321 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringId.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoute circuit peering identifier. + */ +public class ExpressRouteCircuitPeeringId { + /** + * The ID of the ExpressRoute circuit peering. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ID of the ExpressRoute circuit peering. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringState.java new file mode 100644 index 0000000000000..e3a671fc63304 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeerings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeerings.java new file mode 100644 index 0000000000000..423ec16ad5c46 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitPeerings. + */ +public interface ExpressRouteCircuitPeerings extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitReference.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitReference.java new file mode 100644 index 0000000000000..c2d3d8f1e9f4d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Reference to an express route circuit. + */ +public class ExpressRouteCircuitReference { + /** + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get corresponding Express Route Circuit Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 0000000000000..5a7102a39279d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTable.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTable { + /** + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /** + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /** + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /** + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /** + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get iP address of a network entity. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Set 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 nextHop address. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set 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 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 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 route Weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + + /** + * Set 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 autonomous system paths to the destination network. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTableSummary.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 0000000000000..b0c70a7f4ce7b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTableSummary { + /** + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get iP address of the neighbor. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set 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 bGP version number spoken to the neighbor. + * + * @return the v value + */ + public Integer v() { + return this.v; + } + + /** + * Set 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 autonomous system number. + * + * @return the as value + */ + public Integer as() { + return this.as; + } + + /** + * Set 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 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitServiceProviderProperties.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 0000000000000..115e2f6b1706f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitServiceProviderProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitServiceProviderProperties { + /** + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /** + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /** + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName. + * + * @return the serviceProviderName value + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set 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 peering location. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set 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. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSku.java new file mode 100644 index 0000000000000..bd7753375a713 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSku.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains SKU in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU. Possible values are 'Standard', 'Premium' or + * 'Local'. Possible values include: 'Standard', 'Premium', 'Basic', + * 'Local'. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /** + * The family of the SKU. Possible values are: 'UnlimitedData' and + * 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the SKU. Possible values are 'Standard', 'Premium' or 'Local'. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'. + * + * @return the tier value + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU. Possible values are 'Standard', 'Premium' or 'Local'. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'. + * + * @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 of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @return the family value + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @param family the family value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuFamily.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 0000000000000..b7915677ce1cb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuFamily.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuTier.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuTier.java new file mode 100644 index 0000000000000..74b42daa8bec1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitSkuTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitStats.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitStats.java new file mode 100644 index 0000000000000..82338ff14c173 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitStats.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitStats. + */ +public interface ExpressRouteCircuitStats extends HasInner, HasManager { + /** + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuits.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..ab0f603efa5f2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuits.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuits. + */ +public interface ExpressRouteCircuits extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listArpTableAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * 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 + * @return the observable for the request + */ + Observable getStatsAsync(String resourceGroupName, String circuitName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsArpTableListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsArpTableListResult.java new file mode 100644 index 0000000000000..4d86c220734b9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsArpTableListResult. + */ +public interface ExpressRouteCircuitsArpTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 0000000000000..688586c41c1dd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableListResult. + */ +public interface ExpressRouteCircuitsRoutesTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..0652c412143e0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnection.java new file mode 100644 index 0000000000000..11fe04e833346 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnection.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteConnection. + */ +public interface ExpressRouteConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the expressRouteCircuitPeering value. + */ + ExpressRouteCircuitPeeringId expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * The entirety of the ExpressRouteConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteGateway, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithName, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteConnection definition. + */ + interface Blank extends WithExpressRouteGateway { + } + + /** + * The stage of the expressrouteconnection definition allowing to specify ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies resourceGroupName, expressRouteGatewayName. + * @param resourceGroupName The name of the resource group + * @param expressRouteGatewayName The name of the ExpressRoute gateway + * @return the next definition stage + */ + WithExpressRouteCircuitPeering withExistingExpressRouteGateway(String resourceGroupName, String expressRouteGatewayName); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + * @param expressRouteCircuitPeering The ExpressRoute circuit peering + * @return the next definition stage + */ + WithName withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey Authorization key to establish the connection + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the expressrouteconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight associated to the connection + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithId, DefinitionStages.WithProvisioningState, DefinitionStages.WithRoutingWeight { + } + } + /** + * The template for a ExpressRouteConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithId, UpdateStages.WithProvisioningState, UpdateStages.WithRoutingWeight { + } + + /** + * Grouping of ExpressRouteConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressrouteconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey Authorization key to establish the connection + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressrouteconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressrouteconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the expressrouteconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight associated to the connection + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionId.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionId.java new file mode 100644 index 0000000000000..0eaede0047ecf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ID of the ExpressRouteConnection. + */ +public class ExpressRouteConnectionId { + /** + * The ID of the ExpressRouteConnection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the ID of the ExpressRouteConnection. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionList.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionList.java new file mode 100644 index 0000000000000..eb2c73e7f6c32 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnectionList.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteConnectionListInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteConnectionInner; +import java.util.List; + +/** + * Type representing ExpressRouteConnectionList. + */ +public interface ExpressRouteConnectionList extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnections.java new file mode 100644 index 0000000000000..40f65814c3210 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteConnections. + */ +public interface ExpressRouteConnections extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String expressRouteGatewayName); + + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnection.java new file mode 100644 index 0000000000000..48c261aa6e45a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnection.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionInner; + +/** + * Type representing ExpressRouteCrossConnection. + */ +public interface ExpressRouteCrossConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bandwidthInMbps value. + */ + Integer bandwidthInMbps(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuit value. + */ + ExpressRouteCircuitReference expressRouteCircuit(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sTag value. + */ + Integer sTag(); + + /** + * The entirety of the ExpressRouteCrossConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next definition stage + */ + WithCreate withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next definition stage + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next definition stage + */ + WithCreate withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection definition allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @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 ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next definition stage + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInMbps, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithPeeringLocation, DefinitionStages.WithPeerings, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProvisioningState { + } + } + /** + * The template for a ExpressRouteCrossConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInMbps, UpdateStages.WithExpressRouteCircuit, UpdateStages.WithPeeringLocation, UpdateStages.WithPeerings, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProvisioningState { + } + + /** + * Grouping of ExpressRouteCrossConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnection update allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + * @param bandwidthInMbps The circuit bandwidth In Mbps + * @return the next update stage + */ + Update withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + * @param expressRouteCircuit The ExpressRouteCircuit + * @return the next update stage + */ + Update withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The peering location of the ExpressRoute circuit + * @return the next update stage + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings The list of peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + * @param serviceProviderNotes Additional read only notes set by the connectivity provider + * @return the next update stage + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + * @return the next update stage + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeering.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..73c9c793ba4ed --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,475 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCrossConnectionPeering. + */ +public interface ExpressRouteCrossConnectionPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCrossConnectionPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCrossConnection, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnectionPeering definition. + */ + interface Blank extends WithExpressRouteCrossConnection { + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify ExpressRouteCrossConnection. + */ + interface WithExpressRouteCrossConnection { + /** + * Specifies resourceGroupName, crossConnectionName. + * @param resourceGroupName The name of the resource group + * @param crossConnectionName The name of the ExpressRouteCrossConnection + * @return the next definition stage + */ + WithCreate withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next definition stage + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next definition stage + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next definition stage + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next definition stage + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets 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 expressroutecrossconnectionpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next definition stage + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next definition stage + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next definition stage + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next definition stage + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next definition stage + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCrossConnectionPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + * @param gatewayManagerEtag The GatewayManager Etag + * @return the next update stage + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + * @param ipv6PeeringConfig The IPv6 peering configuration + * @return the next update stage + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + * @param lastModifiedBy Gets whether the provider or the customer last modified the peering + * @return the next update stage + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + * @param microsoftPeeringConfig The Microsoft peering configuration + * @return the next update stage + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + * @param peerASN The peer ASN + * @return the next update stage + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + * @param peeringType The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + * @return the next update stage + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + * @param primaryPeerAddressPrefix The primary address prefix + * @return the next update stage + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + * @param secondaryPeerAddressPrefix The secondary address prefix + * @return the next update stage + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The peering state. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + * @param vlanId The VLAN ID + * @return the next update stage + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeerings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 0000000000000..d0e268ebcad5c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnectionPeerings. + */ +public interface ExpressRouteCrossConnectionPeerings extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String crossConnectionName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionRoutesTableSummary.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 0000000000000..eb035f48d68a6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCrossConnectionRoutesTableSummary { + /** + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get iP address of Neighbor router. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set 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 autonomous system number. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Set 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 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnections.java new file mode 100644 index 0000000000000..d534bc242dd4d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnections.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnections. + */ +public interface ExpressRouteCrossConnections extends SupportsCreating, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listArpTableAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java new file mode 100644 index 0000000000000..8537e2296b47a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCrossConnectionsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateway.java new file mode 100644 index 0000000000000..39b007f0d6c74 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateway.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteGatewayInner; + +/** + * Type representing ExpressRouteGateway. + */ +public interface ExpressRouteGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the autoScaleConfiguration value. + */ + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteConnections value. + */ + List expressRouteConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + VirtualHubId virtualHub(); + + /** + * The entirety of the ExpressRouteGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithVirtualHub, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutegateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The Virtual Hub where the ExpressRoute gateway is or will be deployed + * @return the next definition stage +*/ + WithCreate withVirtualHub(VirtualHubId virtualHub); + } + + /** + * The stage of the expressroutegateway definition allowing to specify AutoScaleConfiguration. + */ + interface WithAutoScaleConfiguration { + /** + * Specifies autoScaleConfiguration. + * @param autoScaleConfiguration Configuration for auto scaling + * @return the next definition stage + */ + WithCreate withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + + /** + * The stage of the expressroutegateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAutoScaleConfiguration, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a ExpressRouteGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAutoScaleConfiguration, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of ExpressRouteGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutegateway update allowing to specify AutoScaleConfiguration. + */ + interface WithAutoScaleConfiguration { + /** + * Specifies autoScaleConfiguration. + * @param autoScaleConfiguration Configuration for auto scaling + * @return the next update stage + */ + Update withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + + /** + * The stage of the expressroutegateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java new file mode 100644 index 0000000000000..61496f095bac8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration for auto scaling. + */ +public class ExpressRouteGatewayPropertiesAutoScaleConfiguration { + /** + * Minimum and maximum number of scale units to deploy. + */ + @JsonProperty(value = "bounds") + private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; + + /** + * Get minimum and maximum number of scale units to deploy. + * + * @return the bounds value + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds() { + return this.bounds; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java new file mode 100644 index 0000000000000..169838f8f7126 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Minimum and maximum number of scale units to deploy. + */ +public class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + /** + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "min") + private Integer min; + + /** + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get minimum number of scale units deployed for ExpressRoute gateway. + * + * @return the min value + */ + public Integer min() { + return this.min; + } + + /** + * Set 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 maximum number of scale units deployed for ExpressRoute gateway. + * + * @return the max value + */ + public Integer max() { + return this.max; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateways.java new file mode 100644 index 0000000000000..b199f31557d9f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteGateways. + */ +public interface ExpressRouteGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLink.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLink.java new file mode 100644 index 0000000000000..b6ff2d29475e7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLink.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteLinkInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteLink. + */ +public interface ExpressRouteLink extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the adminState value. + */ + ExpressRouteLinkAdminState adminState(); + + /** + * @return the connectorType value. + */ + ExpressRouteLinkConnectorType connectorType(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the patchPanelId value. + */ + String patchPanelId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rackId value. + */ + String rackId(); + + /** + * @return the routerName value. + */ + String routerName(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkAdminState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkAdminState.java new file mode 100644 index 0000000000000..1e64570c63d90 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkAdminState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkConnectorType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkConnectorType.java new file mode 100644 index 0000000000000..1cd711910ec4e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinkConnectorType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinks.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinks.java new file mode 100644 index 0000000000000..14a21ce8537aa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteLinks.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteLinksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteLinks. + */ +public interface ExpressRouteLinks extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String expressRoutePortName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringState.java new file mode 100644 index 0000000000000..91431c5e67851 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringType.java new file mode 100644 index 0000000000000..19d153bd29fd0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePeeringType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePort.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePort.java new file mode 100644 index 0000000000000..abb56e4ac55e4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePort.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteLinkInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRoutePortInner; + +/** + * Type representing ExpressRoutePort. + */ +public interface ExpressRoutePort extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allocationDate value. + */ + String allocationDate(); + + /** + * @return the bandwidthInGbps value. + */ + Integer bandwidthInGbps(); + + /** + * @return the circuits value. + */ + List circuits(); + + /** + * @return the encapsulation value. + */ + ExpressRoutePortsEncapsulation encapsulation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the etherType value. + */ + String etherType(); + + /** + * @return the links value. + */ + List links(); + + /** + * @return the mtu value. + */ + String mtu(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the provisionedBandwidthInGbps value. + */ + Double provisionedBandwidthInGbps(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ExpressRoutePort definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRoutePort definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRoutePort definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRoutePort definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressrouteport definition allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @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 encapsulation. + * @param encapsulation Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + * @return the next definition stage + */ + WithCreate withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + + /** + * The stage of the expressrouteport definition allowing to specify Links. + */ + interface WithLinks { + /** + * Specifies links. + * @param links The set of physical links of the ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withLinks(List links); + } + + /** + * The stage of the expressrouteport definition allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the ExpressRoutePort resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInGbps, DefinitionStages.WithEncapsulation, DefinitionStages.WithLinks, DefinitionStages.WithPeeringLocation, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a ExpressRoutePort update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInGbps, UpdateStages.WithEncapsulation, UpdateStages.WithLinks, UpdateStages.WithPeeringLocation, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of ExpressRoutePort update stages. + */ + interface UpdateStages { + /** + * The stage of the expressrouteport update allowing to specify BandwidthInGbps. + */ + interface WithBandwidthInGbps { + /** + * Specifies bandwidthInGbps. + * @param bandwidthInGbps Bandwidth of procured ports in Gbps + * @return the next update stage + */ + Update withBandwidthInGbps(Integer bandwidthInGbps); + } + + /** + * The stage of the expressrouteport update allowing to specify Encapsulation. + */ + interface WithEncapsulation { + /** + * Specifies encapsulation. + * @param encapsulation Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + * @return the next update stage + */ + Update withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + + /** + * The stage of the expressrouteport update allowing to specify Links. + */ + interface WithLinks { + /** + * Specifies links. + * @param links The set of physical links of the ExpressRoutePort resource + * @return the next update stage + */ + Update withLinks(List links); + } + + /** + * The stage of the expressrouteport update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + * @param peeringLocation The name of the peering location that the ExpressRoutePort is mapped to physically + * @return the next update stage + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressrouteport update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the ExpressRoutePort resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePorts.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePorts.java new file mode 100644 index 0000000000000..7029de35595f9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePorts.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRoutePortsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRoutePorts. + */ +public interface ExpressRoutePorts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsEncapsulation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsEncapsulation.java new file mode 100644 index 0000000000000..6069d1644a5b7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsEncapsulation.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocation.java new file mode 100644 index 0000000000000..89f438ac9204e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocation.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRoutePortsLocationInner; + +/** + * Type representing ExpressRoutePortsLocation. + */ +public interface ExpressRoutePortsLocation extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the address value. + */ + String address(); + + /** + * @return the availableBandwidths value. + */ + List availableBandwidths(); + + /** + * @return the contact value. + */ + String contact(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocationBandwidths.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocationBandwidths.java new file mode 100644 index 0000000000000..8b8a7217f06a7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocationBandwidths.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRoutePorts Location Bandwidths. + * Real-time inventory of available ExpressRoute port bandwidths. + */ +public class ExpressRoutePortsLocationBandwidths { + /** + * Bandwidth descriptive name. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /** + * Bandwidth value in Gbps. + */ + @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer valueInGbps; + + /** + * Get bandwidth descriptive name. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Get bandwidth value in Gbps. + * + * @return the valueInGbps value + */ + public Integer valueInGbps() { + return this.valueInGbps; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocations.java new file mode 100644 index 0000000000000..98f5ac5e73158 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRoutePortsLocations.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRoutePortsLocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRoutePortsLocations. + */ +public interface ExpressRoutePortsLocations extends SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String locationName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProvider.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProvider.java new file mode 100644 index 0000000000000..ccd46c15ff3b1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProvider.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteServiceProviderInner; + +/** + * Type representing ExpressRouteServiceProvider. + */ +public interface ExpressRouteServiceProvider extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bandwidthsOffered value. + */ + List bandwidthsOffered(); + + /** + * @return the peeringLocations value. + */ + List peeringLocations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviderBandwidthsOffered.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviderBandwidthsOffered.java new file mode 100644 index 0000000000000..73dd54e207046 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviderBandwidthsOffered.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + */ +public class ExpressRouteServiceProviderBandwidthsOffered { + /** + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /** + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the OfferName. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Set 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. + * + * @return the valueInMbps value + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviders.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviders.java new file mode 100644 index 0000000000000..76883277a8b98 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ExpressRouteServiceProviders.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteServiceProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteServiceProviders. + */ +public interface ExpressRouteServiceProviders extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatParameters.java new file mode 100644 index 0000000000000..5889b5c46316c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the flow log format. + */ +public class FlowLogFormatParameters { + /** + * The file type of flow log. Possible values include: 'JSON'. + */ + @JsonProperty(value = "type") + private FlowLogFormatType type; + + /** + * The version (revision) of the flow log. + */ + @JsonProperty(value = "version") + private Integer version; + + /** + * Get the file type of flow log. Possible values include: 'JSON'. + * + * @return the type value + */ + public FlowLogFormatType type() { + return this.type; + } + + /** + * Set the file type of flow log. Possible values include: 'JSON'. + * + * @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 (revision) of the flow log. + * + * @return the version value + */ + public Integer version() { + return this.version; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatType.java new file mode 100644 index 0000000000000..e95f5036411af --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogFormatType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogInformation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogInformation.java new file mode 100644 index 0000000000000..1a36012aafb0a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogInformation.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.FlowLogInformationInner; + +/** + * Type representing FlowLogInformation. + */ +public interface FlowLogInformation extends HasInner, HasManager { + /** + * @return the enabled value. + */ + boolean enabled(); + + /** + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * @return the format value. + */ + FlowLogFormatParameters format(); + + /** + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * @return the storageId value. + */ + String storageId(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogStatusParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogStatusParameters.java new file mode 100644 index 0000000000000..1e2e376dd838a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FlowLogStatusParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. + */ +public class FlowLogStatusParameters { + /** + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FrontendIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FrontendIPConfiguration.java new file mode 100644 index 0000000000000..a30aa89ec0712 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/FrontendIPConfiguration.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing FrontendIPConfiguration. + */ +public interface FrontendIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the zones value. + */ + List zones(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRoute.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRoute.java new file mode 100644 index 0000000000000..f28c6313ddc0a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRoute.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gateway routing details. + */ +public class GatewayRoute { + /** + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /** + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /** + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /** + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /** + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the route's network prefix. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Get the route's next hop. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the peer this route was learned from. + * + * @return the sourcePeer value + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the source this route was learned from. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the route's AS path sequence. + * + * @return the asPath value + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the route's weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRouteListResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRouteListResult.java new file mode 100644 index 0000000000000..c7ac0d56e062e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GatewayRouteListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.GatewayRouteListResultInner; +import java.util.List; + +/** + * Type representing GatewayRouteListResult. + */ +public interface GatewayRouteListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GetVpnSitesConfigurationRequest.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GetVpnSitesConfigurationRequest.java new file mode 100644 index 0000000000000..b564ff5c489d8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/GetVpnSitesConfigurationRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of Vpn-Sites. + */ +public class GetVpnSitesConfigurationRequest { + /** + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /** + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl", required = true) + private String outputBlobSasUrl; + + /** + * Get 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 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 sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPConfiguration.java new file mode 100644 index 0000000000000..fd168314979ef --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HTTP configuration of the connectivity check. + */ +public class HTTPConfiguration { + /** + * HTTP method. Possible values include: 'Get'. + */ + @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 hTTP method. Possible values include: 'Get'. + * + * @return the method value + */ + public HTTPMethod method() { + return this.method; + } + + /** + * Set hTTP method. Possible values include: 'Get'. + * + * @param method the method value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withMethod(HTTPMethod method) { + this.method = method; + return this; + } + + /** + * Get list of HTTP headers. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set 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 valid status codes. + * + * @return the validStatusCodes value + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPHeader.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPHeader.java new file mode 100644 index 0000000000000..f6700783da91b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPHeader.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the HTTP header. + */ +public class HTTPHeader { + /** + * 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 in HTTP header. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 in HTTP header. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPMethod.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPMethod.java new file mode 100644 index 0000000000000..4b3252c0fdfb7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HTTPMethod.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnection.java new file mode 100644 index 0000000000000..aecd0b76aba6c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnection.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing HubVirtualNetworkConnection. + */ +public interface HubVirtualNetworkConnection extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnectionStatus.java new file mode 100644 index 0000000000000..d70549fcae9f7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HubVirtualNetworkConnectionStatus. + */ +public final class HubVirtualNetworkConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubVirtualNetworkConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding HubVirtualNetworkConnectionStatus + */ + @JsonCreator + public static HubVirtualNetworkConnectionStatus fromString(String name) { + return fromString(name, HubVirtualNetworkConnectionStatus.class); + } + + /** + * @return known HubVirtualNetworkConnectionStatus values + */ + public static Collection values() { + return values(HubVirtualNetworkConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnections.java new file mode 100644 index 0000000000000..862e657ec7663 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/HubVirtualNetworkConnections.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.HubVirtualNetworkConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HubVirtualNetworkConnections. + */ +public interface HubVirtualNetworkConnections extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualHubName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAddressAvailabilityResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAddressAvailabilityResult.java new file mode 100644 index 0000000000000..d9721aa066c4c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAddressAvailabilityResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.IPAddressAvailabilityResultInner; +import java.util.List; + +/** + * Type representing IPAddressAvailabilityResult. + */ +public interface IPAddressAvailabilityResult extends HasInner, HasManager { + /** + * @return the available value. + */ + Boolean available(); + + /** + * @return the availableIPAddresses value. + */ + List availableIPAddresses(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAllocationMethod.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAllocationMethod.java new file mode 100644 index 0000000000000..ef8dc36650cef --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPAllocationMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfiguration.java new file mode 100644 index 0000000000000..fbc3f9a043d3b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PublicIPAddressInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration. + */ +@JsonFlatten +public class IPConfiguration extends SubResource { + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP address allocation method. Possible values include: + * 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 IPConfiguration object itself. + */ + public IPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfigurationProfile.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfigurationProfile.java new file mode 100644 index 0000000000000..54071713f1c60 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPConfigurationProfile.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration profile child resource. + */ +@JsonFlatten +public class IPConfigurationProfile extends SubResource { + /** + * The reference of the subnet resource to create a container network + * interface ip configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the reference of the subnet resource to create a container network interface ip configuration. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource to create a container network interface ip configuration. + * + * @param subnet the subnet value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 of the resource. This name can be used to access the resource. + * + * @param name the name value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfigurationProfile object itself. + */ + public IPConfigurationProfile withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPVersion.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPVersion.java new file mode 100644 index 0000000000000..a04b56a4ede37 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IPVersion.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeEncryption.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeEncryption.java new file mode 100644 index 0000000000000..50978933eff02 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeEncryption.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeIntegrity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeIntegrity.java new file mode 100644 index 0000000000000..f36bc72458ab0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IkeIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatPool.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatPool.java new file mode 100644 index 0000000000000..22fd2e4b44d41 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatPool.java @@ -0,0 +1,321 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT pool of the load balancer. + */ +@JsonFlatten +public class InboundNatPool extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * The reference to the transport protocol used by the inbound NAT pool. + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get the reference to the transport protocol used by the inbound NAT pool. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the reference to the transport protocol used by the inbound NAT pool. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 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(int frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get 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 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(int frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get 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 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(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get 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 timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get 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 configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get 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 receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRule.java new file mode 100644 index 0000000000000..b5001f0a3eab5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRule.java @@ -0,0 +1,398 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing InboundNatRule. + */ +public interface InboundNatRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backendIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the InboundNatRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLoadBalancer, DefinitionStages.WithCreate { + } + + /** + * Grouping of InboundNatRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InboundNatRule definition. + */ + interface Blank extends WithLoadBalancer { + } + + /** + * The stage of the inboundnatrule definition allowing to specify LoadBalancer. + */ + interface WithLoadBalancer { + /** + * 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 allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @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 EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @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 enableTcpReset. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @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 FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @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 Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the inboundnatrule definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @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 Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets 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 inboundnatrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol The reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + * @return the next definition stage + */ + WithCreate withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBackendPort, DefinitionStages.WithEnableFloatingIP, DefinitionStages.WithEnableTcpReset, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfiguration, DefinitionStages.WithFrontendPort, DefinitionStages.WithId, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithName, DefinitionStages.WithProtocol, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a InboundNatRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBackendPort, UpdateStages.WithEnableFloatingIP, UpdateStages.WithEnableTcpReset, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfiguration, UpdateStages.WithFrontendPort, UpdateStages.WithId, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithName, UpdateStages.WithProtocol, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of InboundNatRule update stages. + */ + interface UpdateStages { + /** + * The stage of the inboundnatrule update allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + * @param backendPort The port used for the internal endpoint. Acceptable values range from 1 to 65535 + * @return the next update stage + */ + Update withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + * @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 update stage + */ + Update withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableTcpReset. + */ + interface WithEnableTcpReset { + /** + * Specifies enableTcpReset. + * @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 update stage + */ + Update withEnableTcpReset(Boolean enableTcpReset); + } + + /** + * The stage of the inboundnatrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + * @param frontendIPConfiguration A reference to frontend IP addresses + * @return the next update stage + */ + Update withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + * @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 update stage + */ + Update withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the inboundnatrule update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @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 update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name Gets name of the resource that is unique within a resource group. This name can be used to access the resource + * @return the next update stage + */ + Update withName(String name); + } + + /** + * The stage of the inboundnatrule update allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol The reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All' + * @return the next update stage + */ + Update withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRules.java new file mode 100644 index 0000000000000..66bf734a08332 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InboundNatRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.InboundNatRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InboundNatRules. + */ +public interface InboundNatRules extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoint.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoint.java new file mode 100644 index 0000000000000..d17be00ba7be5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoint.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.InterfaceEndpointInner; + +/** + * Type representing InterfaceEndpoint. + */ +public interface InterfaceEndpoint extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the endpointService value. + */ + EndpointService endpointService(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the fqdn value. + */ + String fqdn(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the owner value. + */ + String owner(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * The entirety of the InterfaceEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of InterfaceEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InterfaceEndpoint definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the InterfaceEndpoint definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the interfaceendpoint definition allowing to specify EndpointService. + */ + interface WithEndpointService { + /** + * Specifies endpointService. + * @param endpointService A reference to the service being brought into the virtual network + * @return the next definition stage + */ + WithCreate withEndpointService(EndpointService endpointService); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Fqdn. + */ + interface WithFqdn { + /** + * Specifies fqdn. + * @param fqdn A first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint + * @return the next definition stage + */ + WithCreate withFqdn(String fqdn); + } + + /** + * The stage of the interfaceendpoint definition allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEndpointService, DefinitionStages.WithEtag, DefinitionStages.WithFqdn, DefinitionStages.WithSubnet { + } + } + /** + * The template for a InterfaceEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEndpointService, UpdateStages.WithEtag, UpdateStages.WithFqdn, UpdateStages.WithSubnet { + } + + /** + * Grouping of InterfaceEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the interfaceendpoint update allowing to specify EndpointService. + */ + interface WithEndpointService { + /** + * Specifies endpointService. + * @param endpointService A reference to the service being brought into the virtual network + * @return the next update stage + */ + Update withEndpointService(EndpointService endpointService); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Fqdn. + */ + interface WithFqdn { + /** + * Specifies fqdn. + * @param fqdn A first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint + * @return the next update stage + */ + Update withFqdn(String fqdn); + } + + /** + * The stage of the interfaceendpoint update allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet The ID of the subnet from which the private IP will be allocated + * @return the next update stage + */ + Update withSubnet(SubnetInner subnet); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoints.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoints.java new file mode 100644 index 0000000000000..f4d5e1b64b432 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/InterfaceEndpoints.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.InterfaceEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InterfaceEndpoints. + */ +public interface InterfaceEndpoints extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpFlowProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpFlowProtocol.java new file mode 100644 index 0000000000000..1ad3f01e57a45 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpFlowProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpTag.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpTag.java new file mode 100644 index 0000000000000..addc09558067d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpTag.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IpTag associated with the object. + */ +public class IpTag { + /** + * Gets or sets the ipTag type: Example FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /** + * Gets or sets value of the IpTag associated with the public IP. Example + * SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get gets or sets the ipTag type: Example FirstPartyUsage. + * + * @return the ipTagType value + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set gets or sets the ipTag 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 gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @param tag the tag value to set + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecEncryption.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecEncryption.java new file mode 100644 index 0000000000000..47b7820f5e61c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecEncryption.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecIntegrity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecIntegrity.java new file mode 100644 index 0000000000000..887681945d6d1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecIntegrity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecPolicy.java new file mode 100644 index 0000000000000..9332fb3ba32a9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IpsecPolicy.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec Policy configuration for a virtual network gateway connection. + */ +public class IpsecPolicy { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Group used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Group used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get 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 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 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 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 IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Ipv6ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..507fb317a7349 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains IPv6 peering config. + */ +public class Ipv6ExpressRouteCircuitPeeringConfig { + /** + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private RouteFilterInner routeFilter; + + /** + * The state of peering. Possible values are: 'Disabled' and 'Enabled'. + * Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set 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 secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set 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 Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set 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 reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IssueType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IssueType.java new file mode 100644 index 0000000000000..8d9777a0e648f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/IssueType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancer.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancer.java new file mode 100644 index 0000000000000..0f0b870d35e91 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancer.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.OutboundRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ProbeInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerInner; + +/** + * Type representing LoadBalancer. + */ +public interface LoadBalancer extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * The entirety of the LoadBalancer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LoadBalancer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LoadBalancer definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LoadBalancer definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the loadbalancer definition allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the loadbalancer definition allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @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 InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @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 InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @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 LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @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 OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next definition stage + */ + WithCreate withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer definition allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next definition stage + */ + WithCreate withSku(LoadBalancerSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithInboundNatPools, DefinitionStages.WithInboundNatRules, DefinitionStages.WithLoadBalancingRules, DefinitionStages.WithOutboundRules, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku { + } + } + /** + * The template for a LoadBalancer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBackendAddressPools, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithInboundNatPools, UpdateStages.WithInboundNatRules, UpdateStages.WithLoadBalancingRules, UpdateStages.WithOutboundRules, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSku { + } + + /** + * Grouping of LoadBalancer update stages. + */ + interface UpdateStages { + /** + * The stage of the loadbalancer update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + * @param backendAddressPools Collection of backend address pools used by a load balancer + * @return the next update stage + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the loadbalancer update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + * @param frontendIPConfigurations Object representing the frontend IPs to be used for the load balancer + * @return the next update stage + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + * @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 update stage + */ + Update withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + * @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 update stage + */ + Update withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer update allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + * @param loadBalancingRules Object collection representing the load balancing rules Gets the provisioning + * @return the next update stage + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer update allowing to specify OutboundRules. + */ + interface WithOutboundRules { + /** + * Specifies outboundRules. + * @param outboundRules The outbound rules + * @return the next update stage + */ + Update withOutboundRules(List outboundRules); + } + + /** + * The stage of the loadbalancer update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + * @param probes Collection of probe objects used in the load balancer + * @return the next update stage + */ + Update withProbes(List probes); + } + + /** + * The stage of the loadbalancer update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the load balancer resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The load balancer SKU + * @return the next update stage + */ + Update withSku(LoadBalancerSku sku); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerBackendAddressPools.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerBackendAddressPools.java new file mode 100644 index 0000000000000..38e5ca044cf36 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerBackendAddressPools.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerBackendAddressPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerBackendAddressPools. + */ +public interface LoadBalancerBackendAddressPools extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerFrontendIPConfigurations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerFrontendIPConfigurations.java new file mode 100644 index 0000000000000..8263b14e05e62 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerFrontendIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerFrontendIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerFrontendIPConfigurations. + */ +public interface LoadBalancerFrontendIPConfigurations extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerLoadBalancingRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerLoadBalancingRules.java new file mode 100644 index 0000000000000..3d18d9184f589 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerLoadBalancingRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerLoadBalancingRules. + */ +public interface LoadBalancerLoadBalancingRules extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterface.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterface.java new file mode 100644 index 0000000000000..850d5db341f3c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterface.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancerNetworkInterface. + */ +public interface LoadBalancerNetworkInterface extends HasInner, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceEndpoint value. + */ + InterfaceEndpoint interfaceEndpoint(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tapConfigurations value. + */ + List tapConfigurations(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterfaces.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterfaces.java new file mode 100644 index 0000000000000..55ec1df9a6202 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerNetworkInterfacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerNetworkInterfaces. + */ +public interface LoadBalancerNetworkInterfaces extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRuleProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRuleProtocol.java new file mode 100644 index 0000000000000..305ac08091e84 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRuleProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRules.java new file mode 100644 index 0000000000000..3c1b0ce7c3937 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerOutboundRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerOutboundRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerOutboundRules. + */ +public interface LoadBalancerOutboundRules extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerProbes.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerProbes.java new file mode 100644 index 0000000000000..49f89af4c4214 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerProbes.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerProbesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerProbes. + */ +public interface LoadBalancerProbes extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSku.java new file mode 100644 index 0000000000000..eba2ee49cd2a0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a load balancer. + */ +public class LoadBalancerSku { + /** + * Name of a load balancer SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /** + * Get name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSkuName.java new file mode 100644 index 0000000000000..c8da8d5001e7b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancerSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancers.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancers.java new file mode 100644 index 0000000000000..9e558203c4411 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancers.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancers. + */ +public interface LoadBalancers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancingRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancingRule.java new file mode 100644 index 0000000000000..358a1c03e7e6f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadBalancingRule.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancingRule. + */ +public interface LoadBalancingRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the disableOutboundSnat value. + */ + Boolean disableOutboundSnat(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + int frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the probe value. + */ + SubResource probe(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadDistribution.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadDistribution.java new file mode 100644 index 0000000000000..6f48e4e9f38a2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LoadDistribution.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateway.java new file mode 100644 index 0000000000000..5d4a96e39b18f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateway.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LocalNetworkGatewayInner; + +/** + * Type representing LocalNetworkGateway. + */ +public interface LocalNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayIpAddress value. + */ + String gatewayIpAddress(); + + /** + * @return the localNetworkAddressSpace value. + */ + AddressSpace localNetworkAddressSpace(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the LocalNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LocalNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LocalNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LocalNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the localnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next definition stage + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway definition allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @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 LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithEtag, DefinitionStages.WithGatewayIpAddress, DefinitionStages.WithLocalNetworkAddressSpace, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a LocalNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithEtag, UpdateStages.WithGatewayIpAddress, UpdateStages.WithLocalNetworkAddressSpace, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of LocalNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the localnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway update allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + * @param gatewayIpAddress IP address of local network gateway + * @return the next update stage + */ + Update withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway update allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + * @param localNetworkAddressSpace Local network site address space + * @return the next update stage + */ + Update withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the LocalNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateways.java new file mode 100644 index 0000000000000..16a0a3096cc89 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocalNetworkGateways.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LocalNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocalNetworkGateways. + */ +public interface LocalNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegation.java new file mode 100644 index 0000000000000..f1b5f96f1f761 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegation.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AvailableDelegationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing LocationAvailableDelegation. + */ +public interface LocationAvailableDelegation extends HasInner, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serviceName value. + */ + String serviceName(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegationModel.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegationModel.java new file mode 100644 index 0000000000000..45251c1a9b0e3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LocationAvailableDelegationModel.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.AvailableDelegationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing LocationAvailableDelegationModel. + */ +public interface LocationAvailableDelegationModel extends HasInner, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serviceName value. + */ + String serviceName(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LogSpecification.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LogSpecification.java new file mode 100644 index 0000000000000..e28caf1c43df5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of logging specification. + */ +public class LogSpecification { + /** + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name of the specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 display name of the specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 duration of the blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..255d6b9007eb7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentity.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class ManagedServiceIdentity { + /** + * The principal id of the system assigned identity. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the resource. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. The type 'None' will remove any identities + * from the virtual machine. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the 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 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 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. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set 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. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @param type the type value to set + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentityUserAssignedIdentitiesValue.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..447995b6eb694 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ManagedServiceIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ManagedServiceIdentityUserAssignedIdentitiesValue model. + */ +public class ManagedServiceIdentityUserAssignedIdentitiesValue { + /** + * 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 principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchCondition.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchCondition.java new file mode 100644 index 0000000000000..ae7fed13336f0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchCondition.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Define match conditions. + */ +public class MatchCondition { + /** + * List of match variables. + */ + @JsonProperty(value = "matchVariables", required = true) + private List matchVariables; + + /** + * Describes operator to be matched. Possible values include: 'IPMatch', + * 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + * 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + */ + @JsonProperty(value = "operator", required = true) + private WebApplicationFirewallOperator operator; + + /** + * Describes if 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 list of match variables. + * + * @return the matchVariables value + */ + public List matchVariables() { + return this.matchVariables; + } + + /** + * Set 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 describes operator to be matched. Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + * + * @return the operator value + */ + public WebApplicationFirewallOperator operator() { + return this.operator; + } + + /** + * Set describes operator to be matched. Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + * + * @param operator the operator value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(WebApplicationFirewallOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get describes if this is negate condition or not. + * + * @return the negationConditon value + */ + public Boolean negationConditon() { + return this.negationConditon; + } + + /** + * Set describes if 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 match value. + * + * @return the matchValues value + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set 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 list of transforms. + * + * @return the transforms value + */ + public List transforms() { + return this.transforms; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchVariable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchVariable.java new file mode 100644 index 0000000000000..4360228243eb1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchVariable.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Define match variables. + */ +public class MatchVariable { + /** + * Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', + * 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', + * 'RequestBody', 'RequestCookies'. + */ + @JsonProperty(value = "variableName", required = true) + private WebApplicationFirewallMatchVariable variableName; + + /** + * Describes field of the matchVariable collection. + */ + @JsonProperty(value = "selector") + private String selector; + + /** + * Get match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies'. + * + * @return the variableName value + */ + public WebApplicationFirewallMatchVariable variableName() { + return this.variableName; + } + + /** + * Set match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies'. + * + * @param variableName the variableName value to set + * @return the MatchVariable object itself. + */ + public MatchVariable withVariableName(WebApplicationFirewallMatchVariable variableName) { + this.variableName = variableName; + return this; + } + + /** + * Get describes field of the matchVariable collection. + * + * @return the selector value + */ + public String selector() { + return this.selector; + } + + /** + * Set describes field of the matchVariable collection. + * + * @param selector the selector value to set + * @return the MatchVariable object itself. + */ + public MatchVariable withSelector(String selector) { + this.selector = selector; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchedRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchedRule.java new file mode 100644 index 0000000000000..7437723f02934 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MatchedRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Matched rule. + */ +public class MatchedRule { + /** + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get name of the matched network security rule. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set 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 network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MetricSpecification.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MetricSpecification.java new file mode 100644 index 0000000000000..d6c6acda2267f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/MetricSpecification.java @@ -0,0 +1,382 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of metrics specification. + */ +public class MetricSpecification { + /** + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /** + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /** + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /** + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /** + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set 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 units the metric to be displayed in. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set 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 aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set 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 list of availability. + * + * @return the availabilities value + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set 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 whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set 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 whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set 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 pattern for the filter of the metric. + * + * @return the metricFilterPattern value + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set 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 list of dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set 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 whether the metric is internal. + * + * @return the isInternal value + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set 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 source MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set 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 source MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set 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 resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateway.java new file mode 100644 index 0000000000000..6fd058cc14832 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateway.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NatGatewayInner; + +/** + * Type representing NatGateway. + */ +public interface NatGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * @return the publicIpPrefixes value. + */ + List publicIpPrefixes(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + NatGatewaySku sku(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the NatGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NatGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NatGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NatGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the natgateway definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the natgateway definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the NatGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the natgateway definition allowing to specify PublicIpAddresses. + */ + interface WithPublicIpAddresses { + /** + * Specifies publicIpAddresses. + * @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 publicIpPrefixes. + * @param publicIpPrefixes An array of public ip prefixes associated with the nat gateway resource + * @return the next definition stage + */ + WithCreate withPublicIpPrefixes(List publicIpPrefixes); + } + + /** + * The stage of the natgateway definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the nat gateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the natgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The nat gateway SKU + * @return the next definition stage + */ + WithCreate withSku(NatGatewaySku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIpAddresses, DefinitionStages.WithPublicIpPrefixes, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku { + } + } + /** + * The template for a NatGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIpAddresses, UpdateStages.WithPublicIpPrefixes, UpdateStages.WithResourceGuid, UpdateStages.WithSku { + } + + /** + * Grouping of NatGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the natgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the natgateway update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the nat gateway + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the natgateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the NatGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the natgateway update allowing to specify PublicIpAddresses. + */ + interface WithPublicIpAddresses { + /** + * Specifies publicIpAddresses. + * @param publicIpAddresses An array of public ip addresses associated with the nat gateway resource + * @return the next update stage + */ + Update withPublicIpAddresses(List publicIpAddresses); + } + + /** + * The stage of the natgateway update allowing to specify PublicIpPrefixes. + */ + interface WithPublicIpPrefixes { + /** + * Specifies publicIpPrefixes. + * @param publicIpPrefixes An array of public ip prefixes associated with the nat gateway resource + * @return the next update stage + */ + Update withPublicIpPrefixes(List publicIpPrefixes); + } + + /** + * The stage of the natgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the nat gateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the natgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The nat gateway SKU + * @return the next update stage + */ + Update withSku(NatGatewaySku sku); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySku.java new file mode 100644 index 0000000000000..102b3ce546f43 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of nat gateway. + */ +public class NatGatewaySku { + /** + * Name of Nat Gateway SKU. Possible values include: 'Standard'. + */ + @JsonProperty(value = "name") + private NatGatewaySkuName name; + + /** + * Get name of Nat Gateway SKU. Possible values include: 'Standard'. + * + * @return the name value + */ + public NatGatewaySkuName name() { + return this.name; + } + + /** + * Set name of Nat Gateway SKU. Possible values include: 'Standard'. + * + * @param name the name value to set + * @return the NatGatewaySku object itself. + */ + public NatGatewaySku withName(NatGatewaySkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySkuName.java new file mode 100644 index 0000000000000..a5ba200a70103 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGatewaySkuName.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateways.java new file mode 100644 index 0000000000000..25ea6a9a394ca --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NatGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NatGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NatGateways. + */ +public interface NatGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 0000000000000..ce7ec0b2b9772 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to get network configuration diagnostic. + */ +public class NetworkConfigurationDiagnosticParameters { + /** + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. + * Possible values include: 'Normal', 'Minimum', 'Full'. + */ + @JsonProperty(value = "verbosityLevel") + private VerbosityLevel verbosityLevel; + + /** + * List of network configuration diagnostic profiles. + */ + @JsonProperty(value = "profiles", required = true) + private List profiles; + + /** + * Get 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 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 verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full'. + * + * @return the verbosityLevel value + */ + public VerbosityLevel verbosityLevel() { + return this.verbosityLevel; + } + + /** + * Set verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full'. + * + * @param verbosityLevel the verbosityLevel value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withVerbosityLevel(VerbosityLevel verbosityLevel) { + this.verbosityLevel = verbosityLevel; + return this; + } + + /** + * Get list of network configuration diagnostic profiles. + * + * @return the profiles value + */ + public List profiles() { + return this.profiles; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticProfile.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticProfile.java new file mode 100644 index 0000000000000..310c240cb48a3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticProfile.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to compare with network configuration. + */ +public class NetworkConfigurationDiagnosticProfile { + /** + * The direction of the traffic. Possible values include: 'Inbound', + * 'Outbound'. + */ + @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 '*', port (for example, + * 3389) and port range (for example, 80-100). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction of the traffic. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the traffic. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set 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 traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set 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 traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value + */ + public String destination() { + return this.destination; + } + + /** + * Set 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 traffic destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @return the destinationPort value + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set traffic destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100). + * + * @param destinationPort the destinationPort value to set + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResponse.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..865d533a7be41 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** + * Type representing NetworkConfigurationDiagnosticResponse. + */ +public interface NetworkConfigurationDiagnosticResponse extends HasInner, HasManager { + /** + * @return the results value. + */ + List results(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..356b2b409ecba --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + */ +public class NetworkConfigurationDiagnosticResult { + /** + * Network configuration diagnostic profile. + */ + @JsonProperty(value = "profile") + private NetworkConfigurationDiagnosticProfile profile; + + /** + * Network security group result. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get network configuration diagnostic profile. + * + * @return the profile value + */ + public NetworkConfigurationDiagnosticProfile profile() { + return this.profile; + } + + /** + * Set 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 network security group result. + * + * @return the networkSecurityGroupResult value + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicy.java new file mode 100644 index 0000000000000..f7d50598afab1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicy.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network Intent Policy resource. + */ +@SkipParentValidation +public class NetworkIntentPolicy extends Resource { + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkIntentPolicy object itself. + */ + public NetworkIntentPolicy withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkIntentPolicy object itself. + */ + public NetworkIntentPolicy withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicyConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicyConfiguration.java new file mode 100644 index 0000000000000..82d5c7fb9590c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkIntentPolicyConfiguration.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of NetworkIntentPolicyConfiguration for + * PrepareNetworkPoliciesRequest. + */ +public class NetworkIntentPolicyConfiguration { + /** + * The name of the Network Intent Policy for storing in target + * subscription. + */ + @JsonProperty(value = "networkIntentPolicyName") + private String networkIntentPolicyName; + + /** + * Source network intent policy. + */ + @JsonProperty(value = "sourceNetworkIntentPolicy") + private NetworkIntentPolicy sourceNetworkIntentPolicy; + + /** + * Get the name of the Network Intent Policy for storing in target subscription. + * + * @return the networkIntentPolicyName value + */ + public String networkIntentPolicyName() { + return this.networkIntentPolicyName; + } + + /** + * Set 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 source network intent policy. + * + * @return the sourceNetworkIntentPolicy value + */ + public NetworkIntentPolicy sourceNetworkIntentPolicy() { + return this.sourceNetworkIntentPolicy; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterface.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterface.java new file mode 100644 index 0000000000000..5a2f5b3951570 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterface.java @@ -0,0 +1,407 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceTapConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceInner; + +/** + * Type representing NetworkInterface. + */ +public interface NetworkInterface extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * @return the interfaceEndpoint value. + */ + InterfaceEndpoint interfaceEndpoint(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tapConfigurations value. + */ + List tapConfigurations(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + + /** + * The entirety of the NetworkInterface definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterface definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterface definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkInterface definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkinterface definition allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @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 enableAcceleratedNetworking. + * @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 enableIPForwarding. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterface definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @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 MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next definition stage + */ + WithCreate withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface definition allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next definition stage + */ + WithCreate withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface definition allowing to specify TapConfigurations. + */ + interface WithTapConfigurations { + /** + * Specifies tapConfigurations. + * @param tapConfigurations A list of TapConfigurations of the network interface + * @return the next definition stage + */ + WithCreate withTapConfigurations(List tapConfigurations); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEnableAcceleratedNetworking, DefinitionStages.WithEnableIPForwarding, DefinitionStages.WithEtag, DefinitionStages.WithIpConfigurations, DefinitionStages.WithMacAddress, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithPrimary, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithTapConfigurations { + } + } + /** + * The template for a NetworkInterface update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEnableAcceleratedNetworking, UpdateStages.WithEnableIPForwarding, UpdateStages.WithEtag, UpdateStages.WithIpConfigurations, UpdateStages.WithMacAddress, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithPrimary, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithTapConfigurations { + } + + /** + * Grouping of NetworkInterface update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterface update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The DNS settings in network interface + * @return the next update stage + */ + Update withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface update allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled + * @return the next update stage + */ + Update withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface update allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + * @param enableIPForwarding Indicates whether IP forwarding is enabled on this network interface + * @return the next update stage + */ + Update withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterface update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations A list of IPConfigurations of the network interface + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface update allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + * @param macAddress The MAC address of the network interface + * @return the next update stage + */ + Update withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface update allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + * @param primary Gets whether this is a primary network interface on a virtual machine + * @return the next update stage + */ + Update withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network interface resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface update allowing to specify TapConfigurations. + */ + interface WithTapConfigurations { + /** + * Specifies tapConfigurations. + * @param tapConfigurations A list of TapConfigurations of the network interface + * @return the next update stage + */ + Update withTapConfigurations(List tapConfigurations); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceAssociation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceAssociation.java new file mode 100644 index 0000000000000..f8f5483bcb8cc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class NetworkInterfaceAssociation { + /** + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get network interface ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceDnsSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceDnsSettings.java new file mode 100644 index 0000000000000..d57b32485bd9d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceDnsSettings.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS settings of a network interface. + */ +public class NetworkInterfaceDnsSettings { + /** + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers") + 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") + 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") + private String internalDomainNameSuffix; + + /** + * Get 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 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 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; + } + + /** + * Set 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. + * + * @param appliedDnsServers the appliedDnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withAppliedDnsServers(List appliedDnsServers) { + this.appliedDnsServers = appliedDnsServers; + return this; + } + + /** + * Get 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 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 fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @return the internalFqdn value + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Set fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @param internalFqdn the internalFqdn value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalFqdn(String internalFqdn) { + this.internalFqdn = internalFqdn; + return this; + } + + /** + * Get 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; + } + + /** + * Set 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. + * + * @param internalDomainNameSuffix the internalDomainNameSuffix value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDomainNameSuffix(String internalDomainNameSuffix) { + this.internalDomainNameSuffix = internalDomainNameSuffix; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceIPConfigurations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceIPConfigurations.java new file mode 100644 index 0000000000000..f7ec3bcf01989 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceIPConfigurations. + */ +public interface NetworkInterfaceIPConfigurations extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancer.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancer.java new file mode 100644 index 0000000000000..847c741d3990e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LoadBalancerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NetworkInterfaceLoadBalancer. + */ +public interface NetworkInterfaceLoadBalancer extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundRules value. + */ + List outboundRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancers.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancers.java new file mode 100644 index 0000000000000..b4dca7ca67d17 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceLoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceLoadBalancers. + */ +public interface NetworkInterfaceLoadBalancers extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..2f106d56d4e9d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkInterfaceNetworkInterfaceIPConfiguration. + */ +public interface NetworkInterfaceNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfiguration.java new file mode 100644 index 0000000000000..f99c6a0ee65b8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfiguration.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceTapConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkTapInner; + +/** + * Type representing NetworkInterfaceTapConfiguration. + */ +public interface NetworkInterfaceTapConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkTap value. + */ + VirtualNetworkTap virtualNetworkTap(); + + /** + * The entirety of the NetworkInterfaceTapConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkInterface, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterfaceTapConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterfaceTapConfiguration definition. + */ + interface Blank extends WithNetworkInterface { + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify NetworkInterface. + */ + interface WithNetworkInterface { + /** + * 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 allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the networkinterfacetapconfiguration definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 virtualNetworkTap. + * @param virtualNetworkTap The reference of the Virtual Network Tap resource + * @return the next definition stage + */ + WithCreate withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithVirtualNetworkTap { + } + } + /** + * The template for a NetworkInterfaceTapConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithVirtualNetworkTap { + } + + /** + * Grouping of NetworkInterfaceTapConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the networkinterfacetapconfiguration update allowing to specify VirtualNetworkTap. + */ + interface WithVirtualNetworkTap { + /** + * Specifies virtualNetworkTap. + * @param virtualNetworkTap The reference of the Virtual Network Tap resource + * @return the next update stage + */ + Update withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfigurations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfigurations.java new file mode 100644 index 0000000000000..9afd2c1415cfe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaceTapConfigurations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceTapConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceTapConfigurations. + */ +public interface NetworkInterfaceTapConfigurations extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaces.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaces.java new file mode 100644 index 0000000000000..5910d241f793f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkInterfaces.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterface; +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +/** + * Type representing NetworkInterfaces. + */ +public interface NetworkInterfaces { + /** + * Begins definition for a new NetworkInterface resource. + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank defineNetworkInterface(String name); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * 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 + * @return the observable for the request + */ + Observable getEffectiveRouteTableAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName); + + /** + * 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 + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex); + + /** + * 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 + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * 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 + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetNetworkInterfaceAsync(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 ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetIpConfigurationAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkOperationStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkOperationStatus.java new file mode 100644 index 0000000000000..d65c920659a04 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkOperationStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkOperationStatus. + */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkOperationStatus + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** + * @return known NetworkOperationStatus values + */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfile.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfile.java new file mode 100644 index 0000000000000..2f948db49a47f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfile.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkProfileInner; + +/** + * Type representing NetworkProfile. + */ +public interface NetworkProfile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containerNetworkInterfaceConfigurations value. + */ + List containerNetworkInterfaceConfigurations(); + + /** + * @return the containerNetworkInterfaces value. + */ + List containerNetworkInterfaces(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the NetworkProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkProfile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkProfile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkprofile definition allowing to specify ContainerNetworkInterfaceConfigurations. + */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies containerNetworkInterfaceConfigurations. + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations + * @return the next definition stage + */ + WithCreate withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations); + } + + /** + * The stage of the networkprofile definition allowing to specify ContainerNetworkInterfaces. + */ + interface WithContainerNetworkInterfaces { + /** + * Specifies containerNetworkInterfaces. + * @param containerNetworkInterfaces List of child container network interfaces + * @return the next definition stage + */ + WithCreate withContainerNetworkInterfaces(List containerNetworkInterfaces); + } + + /** + * The stage of the networkprofile definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithContainerNetworkInterfaceConfigurations, DefinitionStages.WithContainerNetworkInterfaces, DefinitionStages.WithEtag { + } + } + /** + * The template for a NetworkProfile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithContainerNetworkInterfaceConfigurations, UpdateStages.WithContainerNetworkInterfaces, UpdateStages.WithEtag { + } + + /** + * Grouping of NetworkProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the networkprofile update allowing to specify ContainerNetworkInterfaceConfigurations. + */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies containerNetworkInterfaceConfigurations. + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations + * @return the next update stage + */ + Update withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations); + } + + /** + * The stage of the networkprofile update allowing to specify ContainerNetworkInterfaces. + */ + interface WithContainerNetworkInterfaces { + /** + * Specifies containerNetworkInterfaces. + * @param containerNetworkInterfaces List of child container network interfaces + * @return the next update stage + */ + Update withContainerNetworkInterfaces(List containerNetworkInterfaces); + } + + /** + * The stage of the networkprofile update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfiles.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfiles.java new file mode 100644 index 0000000000000..58ecdebc060ff --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkProfiles.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkProfiles. + */ +public interface NetworkProfiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..cb9b8d9853d54 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroup.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroup. + */ +public interface NetworkSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the defaultSecurityRules value. + */ + List defaultSecurityRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the securityRules value. + */ + List securityRules(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the NetworkSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networksecuritygroup definition allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next definition stage + */ + WithCreate withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup definition allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next definition stage + */ + WithCreate withSecurityRules(List securityRules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDefaultSecurityRules, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSecurityRules { + } + } + /** + * The template for a NetworkSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDefaultSecurityRules, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSecurityRules { + } + + /** + * Grouping of NetworkSecurityGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroup update allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + * @param defaultSecurityRules The default security rules of network security group + * @return the next update stage + */ + Update withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the network security group resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup update allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + * @param securityRules A collection of security rules of the network security group + * @return the next update stage + */ + Update withSecurityRules(List securityRules); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..075c293dc4fa1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupResult.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded provided traffic query. + */ +public class NetworkSecurityGroupResult { + /** + * The network traffic is allowed or denied. Possible values include: + * 'Allow', 'Deny'. + */ + @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 network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the securityRuleAccessResult value + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get list of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRule.java new file mode 100644 index 0000000000000..ee53f3722007b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRule.java @@ -0,0 +1,590 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroupSecurityRule. + */ +public interface NetworkSecurityGroupSecurityRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * The entirety of the NetworkSecurityGroupSecurityRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithAccess, DefinitionStages.WithDirection, DefinitionStages.WithProtocol, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroupSecurityRule definition. + */ + interface Blank extends WithNetworkSecurityGroup { + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * 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 + */ + WithAccess withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithDirection withAccess(SecurityRuleAccess access); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound' + * @return the next definition stage + */ + WithProtocol withDirection(SecurityRuleDirection direction); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + * @param protocol Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', 'Icmp', 'Esp', and '*'. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*' + * @return the next definition stage + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @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 networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next definition stage + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next definition stage + */ + WithCreate withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @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 networksecuritygroupsecurityrule definition allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next definition stage + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 networksecuritygroupsecurityrule definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @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 networksecuritygroupsecurityrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @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 networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next definition stage + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next definition stage + */ + WithCreate withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @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 networksecuritygroupsecurityrule definition allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next definition stage + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDestinationAddressPrefix, DefinitionStages.WithDestinationAddressPrefixes, DefinitionStages.WithDestinationApplicationSecurityGroups, DefinitionStages.WithDestinationPortRange, DefinitionStages.WithDestinationPortRanges, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPriority, DefinitionStages.WithProvisioningState, DefinitionStages.WithSourceAddressPrefix, DefinitionStages.WithSourceAddressPrefixes, DefinitionStages.WithSourceApplicationSecurityGroups, DefinitionStages.WithSourcePortRange, DefinitionStages.WithSourcePortRanges { + } + } + /** + * The template for a NetworkSecurityGroupSecurityRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDestinationAddressPrefix, UpdateStages.WithDestinationAddressPrefixes, UpdateStages.WithDestinationApplicationSecurityGroups, UpdateStages.WithDestinationPortRange, UpdateStages.WithDestinationPortRanges, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithProvisioningState, UpdateStages.WithSourceAddressPrefix, UpdateStages.WithSourceAddressPrefixes, UpdateStages.WithSourceApplicationSecurityGroups, UpdateStages.WithSourcePortRange, UpdateStages.WithSourcePortRanges { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + * @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 update stage + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges + * @return the next update stage + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + * @param destinationApplicationSecurityGroups The application security group specified as destination + * @return the next update stage + */ + Update withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + * @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 update stage + */ + Update withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + * @param destinationPortRanges The destination port ranges + * @return the next update stage + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + * @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 update stage + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + * @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 update stage + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + * @param sourceAddressPrefixes The CIDR or source IP ranges + * @return the next update stage + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + * @param sourceApplicationSecurityGroups The application security group specified as source + * @return the next update stage + */ + Update withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + * @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 update stage + */ + Update withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + * @param sourcePortRanges The source port ranges + * @return the next update stage + */ + Update withSourcePortRanges(List sourcePortRanges); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRuleModel.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRuleModel.java new file mode 100644 index 0000000000000..136138391e6fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroupSecurityRuleModel.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkSecurityGroupSecurityRuleModel. + */ +public interface NetworkSecurityGroupSecurityRuleModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroups.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroups.java new file mode 100644 index 0000000000000..40e7697e8a859 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkSecurityGroups. + */ +public interface NetworkSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityRulesEvaluationResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 0000000000000..6bdcf40e07b74 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network security rules evaluation result. + */ +public class NetworkSecurityRulesEvaluationResult { + /** + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /** + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /** + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /** + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /** + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get name of the network security rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 value indicating whether protocol is matched. + * + * @return the protocolMatched value + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set 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 value indicating whether source is matched. + * + * @return the sourceMatched value + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set 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 value indicating whether source port is matched. + * + * @return the sourcePortMatched value + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set 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 value indicating whether destination is matched. + * + * @return the destinationMatched value + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set 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 value indicating whether destination port is matched. + * + * @return the destinationPortMatched value + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatcher.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatcher.java new file mode 100644 index 0000000000000..a38bb6654b79b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatcher.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkWatcherInner; + +/** + * Type representing NetworkWatcher. + */ +public interface NetworkWatcher extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the NetworkWatcher definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkWatcher definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkWatcher definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkWatcher definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkwatcher definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkwatcher definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a NetworkWatcher update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of NetworkWatcher update stages. + */ + interface UpdateStages { + /** + * The stage of the networkwatcher update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkwatcher update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatchers.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatchers.java new file mode 100644 index 0000000000000..f608b42997d4a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NetworkWatchers.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.FlowLogInformationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkWatchersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkWatchers. + */ +public interface NetworkWatchers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * 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 + * @return the observable for the request + */ + Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * 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 + * @return the observable for the request + */ + Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * 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 + * @return the observable for the request + */ + Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * 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 + * @return the observable for the request + */ + Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * 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 + * @return the observable for the request + */ + Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * Get network configuration diagnostic. + * + * @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 + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopParameters.java new file mode 100644 index 0000000000000..9f5396d0f9d33 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source and destination endpoint. + */ +public class NextHopParameters { + /** + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIPAddress; + + /** + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get 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 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 source IP address. + * + * @return the sourceIPAddress value + */ + public String sourceIPAddress() { + return this.sourceIPAddress; + } + + /** + * Set 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 destination IP address. + * + * @return the destinationIPAddress value + */ + public String destinationIPAddress() { + return this.destinationIPAddress; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopResult.java new file mode 100644 index 0000000000000..0fd26c4f023e3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NextHopResultInner; + +/** + * Type representing NextHopResult. + */ +public interface NextHopResult extends HasInner, HasManager { + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * @return the routeTableId value. + */ + String routeTableId(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopType.java new file mode 100644 index 0000000000000..d0262199cb504 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/NextHopType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OfficeTrafficCategory.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OfficeTrafficCategory.java new file mode 100644 index 0000000000000..bd801e5216185 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OfficeTrafficCategory.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operation.java new file mode 100644 index 0000000000000..4c9bbc99d5130 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationDisplay.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationDisplay.java new file mode 100644 index 0000000000000..e6115cda54b3b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Network. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 type of the operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationPropertiesFormatServiceSpecification.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 0000000000000..fbcafcf16c29c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specification of the service. + */ +public class OperationPropertiesFormatServiceSpecification { + /** + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get operation service specification. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set 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 operation log specification. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operations.java new file mode 100644 index 0000000000000..4153fe5f97c4f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Origin.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Origin.java new file mode 100644 index 0000000000000..92f50530e5bae --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Origin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OutboundRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OutboundRule.java new file mode 100644 index 0000000000000..4977b0d12dbbe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/OutboundRule.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.OutboundRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing OutboundRule. + */ +public interface OutboundRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allocatedOutboundPorts value. + */ + Integer allocatedOutboundPorts(); + + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + LoadBalancerOutboundRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnGateway.java new file mode 100644 index 0000000000000..ad19e99338337 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnGateway.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.P2SVpnGatewayInner; + +/** + * Type representing P2SVpnGateway. + */ +public interface P2SVpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the customRoutes value. + */ + AddressSpace customRoutes(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the p2SVpnServerConfiguration value. + */ + SubResource p2SVpnServerConfiguration(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * @return the vpnClientAddressPool value. + */ + AddressSpace vpnClientAddressPool(); + + /** + * @return the vpnClientConnectionHealth value. + */ + VpnClientConnectionHealth vpnClientConnectionHealth(); + + /** + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * The entirety of the P2SVpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of P2SVpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a P2SVpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the P2SVpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the p2svpngateway definition allowing to specify CustomRoutes. + */ + interface WithCustomRoutes { + /** + * Specifies customRoutes. + * @param customRoutes The reference of the address space resource which represents the custom routes specified by the customer for P2SVpnGateway and P2S VpnClient + * @return the next definition stage + */ + WithCreate withCustomRoutes(AddressSpace customRoutes); + } + + /** + * The stage of the p2svpngateway definition allowing to specify P2SVpnServerConfiguration. + */ + interface WithP2SVpnServerConfiguration { + /** + * Specifies p2SVpnServerConfiguration. + * @param p2SVpnServerConfiguration The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration); + } + + /** + * The stage of the p2svpngateway definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the p2svpngateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @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 VpnClientAddressPool. + */ + interface WithVpnClientAddressPool { + /** + * Specifies vpnClientAddressPool. + * @param vpnClientAddressPool The reference of the address space resource which represents Address space for P2S VpnClient + * @return the next definition stage + */ + WithCreate withVpnClientAddressPool(AddressSpace vpnClientAddressPool); + } + + /** + * The stage of the p2svpngateway definition allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this p2s vpn gateway + * @return the next definition stage + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCustomRoutes, DefinitionStages.WithP2SVpnServerConfiguration, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub, DefinitionStages.WithVpnClientAddressPool, DefinitionStages.WithVpnGatewayScaleUnit { + } + } + /** + * The template for a P2SVpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCustomRoutes, UpdateStages.WithP2SVpnServerConfiguration, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub, UpdateStages.WithVpnClientAddressPool, UpdateStages.WithVpnGatewayScaleUnit { + } + + /** + * Grouping of P2SVpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the p2svpngateway update allowing to specify CustomRoutes. + */ + interface WithCustomRoutes { + /** + * Specifies customRoutes. + * @param customRoutes The reference of the address space resource which represents the custom routes specified by the customer for P2SVpnGateway and P2S VpnClient + * @return the next update stage + */ + Update withCustomRoutes(AddressSpace customRoutes); + } + + /** + * The stage of the p2svpngateway update allowing to specify P2SVpnServerConfiguration. + */ + interface WithP2SVpnServerConfiguration { + /** + * Specifies p2SVpnServerConfiguration. + * @param p2SVpnServerConfiguration The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to + * @return the next update stage + */ + Update withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration); + } + + /** + * The stage of the p2svpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the p2svpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next update stage + */ + Update withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the p2svpngateway update allowing to specify VpnClientAddressPool. + */ + interface WithVpnClientAddressPool { + /** + * Specifies vpnClientAddressPool. + * @param vpnClientAddressPool The reference of the address space resource which represents Address space for P2S VpnClient + * @return the next update stage + */ + Update withVpnClientAddressPool(AddressSpace vpnClientAddressPool); + } + + /** + * The stage of the p2svpngateway update allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this p2s vpn gateway + * @return the next update stage + */ + Update withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnProfileParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnProfileParameters.java new file mode 100644 index 0000000000000..8ddf73cb0496f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnProfileParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class P2SVpnProfileParameters { + /** + * VPN client authentication method. Possible values include: 'EAPTLS', + * 'EAPMSCHAPv2'. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the P2SVpnProfileParameters object itself. + */ + public P2SVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusClientRootCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusClientRootCertificate.java new file mode 100644 index 0000000000000..2dc032ca6c527 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Radius client root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigRadiusClientRootCertificate extends SubResource { + /** + * The Radius client root certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the Radius client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the Radius client root certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the Radius client root certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the Radius client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigRadiusClientRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusServerRootCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusServerRootCertificate.java new file mode 100644 index 0000000000000..8921464043c30 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigRadiusServerRootCertificate.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Radius Server root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigRadiusServerRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the P2SVpnServerConfiguration Radius Server + * root certificate resource. Possible values are: 'Updating', 'Deleting', + * and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration Radius Server root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigRadiusServerRootCertificate object itself. + */ + public P2SVpnServerConfigRadiusServerRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRevokedCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..5dd38b175fc76 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigVpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigVpnClientRevokedCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRootCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRootCertificate.java new file mode 100644 index 0000000000000..264fea41b064e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfigVpnClientRootCertificate.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of P2SVpnServerConfiguration. + */ +@JsonFlatten +public class P2SVpnServerConfigVpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the P2SVpnServerConfiguration VPN client root + * certificate resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the P2SVpnServerConfigVpnClientRootCertificate object itself. + */ + public P2SVpnServerConfigVpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfiguration.java new file mode 100644 index 0000000000000..ccca848e48032 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2SVpnServerConfiguration.java @@ -0,0 +1,438 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.P2SVpnServerConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing P2SVpnServerConfiguration. + */ +public interface P2SVpnServerConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the p2SVpnGateways value. + */ + List p2SVpnGateways(); + + /** + * @return the p2SVpnServerConfigRadiusClientRootCertificates value. + */ + List p2SVpnServerConfigRadiusClientRootCertificates(); + + /** + * @return the p2SVpnServerConfigRadiusServerRootCertificates value. + */ + List p2SVpnServerConfigRadiusServerRootCertificates(); + + /** + * @return the p2SVpnServerConfigurationPropertiesEtag value. + */ + String p2SVpnServerConfigurationPropertiesEtag(); + + /** + * @return the p2SVpnServerConfigurationPropertiesName value. + */ + String p2SVpnServerConfigurationPropertiesName(); + + /** + * @return the p2SVpnServerConfigVpnClientRevokedCertificates value. + */ + List p2SVpnServerConfigVpnClientRevokedCertificates(); + + /** + * @return the p2SVpnServerConfigVpnClientRootCertificates value. + */ + List p2SVpnServerConfigVpnClientRootCertificates(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the radiusServerAddress value. + */ + String radiusServerAddress(); + + /** + * @return the radiusServerSecret value. + */ + String radiusServerSecret(); + + /** + * @return the vpnClientIpsecPolicies value. + */ + List vpnClientIpsecPolicies(); + + /** + * @return the vpnProtocols value. + */ + List vpnProtocols(); + + /** + * The entirety of the P2SVpnServerConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualWan, DefinitionStages.WithCreate { + } + + /** + * Grouping of P2SVpnServerConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a P2SVpnServerConfiguration definition. + */ + interface Blank extends WithVirtualWan { + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies resourceGroupName, virtualWanName. + * @param resourceGroupName The resource group name of the VirtualWan + * @param virtualWanName The name of the VirtualWan + * @return the next definition stage + */ + WithCreate withExistingVirtualWan(String resourceGroupName, String virtualWanName); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigRadiusClientRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusClientRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusClientRootCertificates. + * @param p2SVpnServerConfigRadiusClientRootCertificates Radius client root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigRadiusServerRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusServerRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusServerRootCertificates. + * @param p2SVpnServerConfigRadiusServerRootCertificates Radius Server root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigurationPropertiesEtag. + */ + interface WithP2SVpnServerConfigurationPropertiesEtag { + /** + * Specifies p2SVpnServerConfigurationPropertiesEtag. + * @param p2SVpnServerConfigurationPropertiesEtag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigurationPropertiesName. + */ + interface WithP2SVpnServerConfigurationPropertiesName { + /** + * Specifies p2SVpnServerConfigurationPropertiesName. + * @param p2SVpnServerConfigurationPropertiesName The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigVpnClientRevokedCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRevokedCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRevokedCertificates. + * @param p2SVpnServerConfigVpnClientRevokedCertificates VPN client revoked certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify P2SVpnServerConfigVpnClientRootCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRootCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRootCertificates. + * @param p2SVpnServerConfigVpnClientRootCertificates VPN client root certificate of P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify RadiusServerAddress. + */ + interface WithRadiusServerAddress { + /** + * Specifies radiusServerAddress. + * @param radiusServerAddress The radius server address property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next definition stage + */ + WithCreate withRadiusServerAddress(String radiusServerAddress); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify RadiusServerSecret. + */ + interface WithRadiusServerSecret { + /** + * Specifies radiusServerSecret. + * @param radiusServerSecret The radius secret property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next definition stage + */ + WithCreate withRadiusServerSecret(String radiusServerSecret); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VpnClientIpsecPolicies. + */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies vpnClientIpsecPolicies. + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + + /** + * The stage of the p2svpnserverconfiguration definition allowing to specify VpnProtocols. + */ + interface WithVpnProtocols { + /** + * Specifies vpnProtocols. + * @param vpnProtocols VPN protocols for the P2SVpnServerConfiguration + * @return the next definition stage + */ + WithCreate withVpnProtocols(List vpnProtocols); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithP2SVpnServerConfigRadiusClientRootCertificates, DefinitionStages.WithP2SVpnServerConfigRadiusServerRootCertificates, DefinitionStages.WithP2SVpnServerConfigurationPropertiesEtag, DefinitionStages.WithP2SVpnServerConfigurationPropertiesName, DefinitionStages.WithP2SVpnServerConfigVpnClientRevokedCertificates, DefinitionStages.WithP2SVpnServerConfigVpnClientRootCertificates, DefinitionStages.WithRadiusServerAddress, DefinitionStages.WithRadiusServerSecret, DefinitionStages.WithVpnClientIpsecPolicies, DefinitionStages.WithVpnProtocols { + } + } + /** + * The template for a P2SVpnServerConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithP2SVpnServerConfigRadiusClientRootCertificates, UpdateStages.WithP2SVpnServerConfigRadiusServerRootCertificates, UpdateStages.WithP2SVpnServerConfigurationPropertiesEtag, UpdateStages.WithP2SVpnServerConfigurationPropertiesName, UpdateStages.WithP2SVpnServerConfigVpnClientRevokedCertificates, UpdateStages.WithP2SVpnServerConfigVpnClientRootCertificates, UpdateStages.WithRadiusServerAddress, UpdateStages.WithRadiusServerSecret, UpdateStages.WithVpnClientIpsecPolicies, UpdateStages.WithVpnProtocols { + } + + /** + * Grouping of P2SVpnServerConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the p2svpnserverconfiguration update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigRadiusClientRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusClientRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusClientRootCertificates. + * @param p2SVpnServerConfigRadiusClientRootCertificates Radius client root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigRadiusServerRootCertificates. + */ + interface WithP2SVpnServerConfigRadiusServerRootCertificates { + /** + * Specifies p2SVpnServerConfigRadiusServerRootCertificates. + * @param p2SVpnServerConfigRadiusServerRootCertificates Radius Server root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigurationPropertiesEtag. + */ + interface WithP2SVpnServerConfigurationPropertiesEtag { + /** + * Specifies p2SVpnServerConfigurationPropertiesEtag. + * @param p2SVpnServerConfigurationPropertiesEtag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigurationPropertiesName. + */ + interface WithP2SVpnServerConfigurationPropertiesName { + /** + * Specifies p2SVpnServerConfigurationPropertiesName. + * @param p2SVpnServerConfigurationPropertiesName The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name + * @return the next update stage + */ + Update withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigVpnClientRevokedCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRevokedCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRevokedCertificates. + * @param p2SVpnServerConfigVpnClientRevokedCertificates VPN client revoked certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify P2SVpnServerConfigVpnClientRootCertificates. + */ + interface WithP2SVpnServerConfigVpnClientRootCertificates { + /** + * Specifies p2SVpnServerConfigVpnClientRootCertificates. + * @param p2SVpnServerConfigVpnClientRootCertificates VPN client root certificate of P2SVpnServerConfiguration + * @return the next update stage + */ + Update withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify RadiusServerAddress. + */ + interface WithRadiusServerAddress { + /** + * Specifies radiusServerAddress. + * @param radiusServerAddress The radius server address property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next update stage + */ + Update withRadiusServerAddress(String radiusServerAddress); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify RadiusServerSecret. + */ + interface WithRadiusServerSecret { + /** + * Specifies radiusServerSecret. + * @param radiusServerSecret The radius secret property of the P2SVpnServerConfiguration resource for point to site client connection + * @return the next update stage + */ + Update withRadiusServerSecret(String radiusServerSecret); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify VpnClientIpsecPolicies. + */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies vpnClientIpsecPolicies. + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for P2SVpnServerConfiguration + * @return the next update stage + */ + Update withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + + /** + * The stage of the p2svpnserverconfiguration update allowing to specify VpnProtocols. + */ + interface WithVpnProtocols { + /** + * Specifies vpnProtocols. + * @param vpnProtocols VPN protocols for the P2SVpnServerConfiguration + * @return the next update stage + */ + Update withVpnProtocols(List vpnProtocols); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnGateways.java new file mode 100644 index 0000000000000..e5265202bb4c8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnGateways.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.P2sVpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing P2sVpnGateways. + */ +public interface P2sVpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnServerConfigurations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnServerConfigurations.java new file mode 100644 index 0000000000000..9f1d10b44c3f7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/P2sVpnServerConfigurations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.P2sVpnServerConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing P2sVpnServerConfigurations. + */ +public interface P2sVpnServerConfigurations extends SupportsCreating, HasInner { + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName); + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureFilter.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureFilter.java new file mode 100644 index 0000000000000..b383caa4a98e7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureFilter.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + */ +public class PacketCaptureFilter { + /** + * Protocol to be filtered on. Possible values include: 'TCP', 'UDP', + * 'Any'. + */ + @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 protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @return the protocol value + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @param protocol the protocol value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 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 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 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 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureParameters.java new file mode 100644 index 0000000000000..963414e617541 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureParameters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the create packet capture operation. + */ +public class PacketCaptureParameters { + /** + * 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 Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * Describes 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 ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set 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 number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set 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(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set 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 describes the storage location for a packet capture session. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set describes 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 a list of packet capture filters. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureQueryStatusResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureQueryStatusResult.java new file mode 100644 index 0000000000000..66d7be7af216c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureQueryStatusResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PacketCaptureQueryStatusResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PacketCaptureQueryStatusResult. + */ +public interface PacketCaptureQueryStatusResult extends HasInner, HasManager { + /** + * @return the captureStartTime value. + */ + DateTime captureStartTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * @return the stopReason value. + */ + String stopReason(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureResult.java new file mode 100644 index 0000000000000..8a60ad5b279e2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureResult.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PacketCaptureResultInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing PacketCaptureResult. + */ +public interface PacketCaptureResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the bytesToCapturePerPacket value. + */ + Integer bytesToCapturePerPacket(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the filters value. + */ + List filters(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * @return the totalBytesPerSession value. + */ + Integer totalBytesPerSession(); + + /** + * The entirety of the PacketCaptureResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithStorageLocation, DefinitionStages.WithTarget, DefinitionStages.WithCreate { + } + + /** + * Grouping of PacketCaptureResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PacketCaptureResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the packetcaptureresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + * @param resourceGroupName The name of the resource group + * @param networkWatcherName The name of the network watcher + * @return the next definition stage + */ + WithStorageLocation withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify StorageLocation. + */ + interface WithStorageLocation { + /** + * Specifies storageLocation. + * @param storageLocation Describes the storage location for a packet capture session + * @return the next definition stage + */ + WithTarget withStorageLocation(PacketCaptureStorageLocation storageLocation); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Target. + */ + interface WithTarget { + /** + * Specifies target. + * @param target The ID of the targeted resource, only VM is currently supported + * @return the next definition stage + */ + WithCreate withTarget(String target); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next definition stage + */ + WithCreate withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters A list of packet capture filters + * @return the next definition stage + */ + WithCreate withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next definition stage + */ + WithCreate withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next definition stage + */ + WithCreate withTotalBytesPerSession(Integer totalBytesPerSession); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithBytesToCapturePerPacket, DefinitionStages.WithFilters, DefinitionStages.WithTimeLimitInSeconds, DefinitionStages.WithTotalBytesPerSession { + } + } + /** + * The template for a PacketCaptureResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBytesToCapturePerPacket, UpdateStages.WithFilters, UpdateStages.WithTimeLimitInSeconds, UpdateStages.WithTotalBytesPerSession { + } + + /** + * Grouping of PacketCaptureResult update stages. + */ + interface UpdateStages { + /** + * The stage of the packetcaptureresult update allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + * @param bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated + * @return the next update stage + */ + Update withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult update allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + * @param filters A list of packet capture filters + * @return the next update stage + */ + Update withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + * @param timeLimitInSeconds Maximum duration of the capture session in seconds + * @return the next update stage + */ + Update withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + * @param totalBytesPerSession Maximum size of the capture output + * @return the next update stage + */ + Update withTotalBytesPerSession(Integer totalBytesPerSession); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureStorageLocation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureStorageLocation.java new file mode 100644 index 0000000000000..160ce4494e984 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptureStorageLocation.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the storage location for a packet capture session. + */ +public class PacketCaptureStorageLocation { + /** + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /** + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /** + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get 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 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 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptures.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptures.java new file mode 100644 index 0000000000000..bbef4ada040ab --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PacketCaptures.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PacketCapturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PacketCaptures. + */ +public interface PacketCaptures extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatusAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilter.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilter.java new file mode 100644 index 0000000000000..23de0033e5b4f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilter.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitPeeringInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +public class PatchRouteFilter extends SubResource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilterRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilterRule.java new file mode 100644 index 0000000000000..55459b831d34d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PatchRouteFilterRule.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class PatchRouteFilterRule extends SubResource { + /** + * The access type of the rule. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of PatchRouteFilterRule class. + * @param access the access type of the rule. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public PatchRouteFilterRule() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get 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 collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcError.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcError.java new file mode 100644 index 0000000000000..ca68ec6b4b789 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcError.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcProtocol.java new file mode 100644 index 0000000000000..942d546651733 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcStatus.java new file mode 100644 index 0000000000000..db595fd1b215e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PcStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..c0c383685e847 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnection.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PeerExpressRouteCircuitConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing PeerExpressRouteCircuitConnection. + */ +public interface PeerExpressRouteCircuitConnection extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authResourceGuid value. + */ + String authResourceGuid(); + + /** + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * @return the connectionName value. + */ + String connectionName(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..b48c345771ead --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PeerExpressRouteCircuitConnections.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PeerExpressRouteCircuitConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PeerExpressRouteCircuitConnections. + */ +public interface PeerExpressRouteCircuitConnections extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName, final String peeringName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PfsGroup.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PfsGroup.java new file mode 100644 index 0000000000000..f9fec3d726d46 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PfsGroup.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PolicySettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PolicySettings.java new file mode 100644 index 0000000000000..18a9cd5a5871d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PolicySettings.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines contents of a web application firewall global configuration. + */ +public class PolicySettings { + /** + * Describes if the policy is in enabled state or disabled state. Possible + * values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "enabledState") + private WebApplicationFirewallEnabledState enabledState; + + /** + * Describes if it is in detection mode or prevention mode at policy + * level. Possible values include: 'Prevention', 'Detection'. + */ + @JsonProperty(value = "mode") + private WebApplicationFirewallMode mode; + + /** + * Get describes if the policy is in enabled state or disabled state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the enabledState value + */ + public WebApplicationFirewallEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set describes if the policy is in enabled state or disabled state. Possible values include: 'Disabled', 'Enabled'. + * + * @param enabledState the enabledState value to set + * @return the PolicySettings object itself. + */ + public PolicySettings withEnabledState(WebApplicationFirewallEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection'. + * + * @return the mode value + */ + public WebApplicationFirewallMode mode() { + return this.mode; + } + + /** + * Set describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection'. + * + * @param mode the mode value to set + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(WebApplicationFirewallMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PrepareNetworkPoliciesRequest.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PrepareNetworkPoliciesRequest.java new file mode 100644 index 0000000000000..d695efa63747b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PrepareNetworkPoliciesRequest.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of PrepareNetworkPolicies for Subnet. + */ +public class PrepareNetworkPoliciesRequest { + /** + * The name of the service for which subnet is being prepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * The name of the resource group where the Network Intent Policy will be + * stored. + */ + @JsonProperty(value = "resourceGroupName") + private String resourceGroupName; + + /** + * A list of NetworkIntentPolicyConfiguration. + */ + @JsonProperty(value = "networkIntentPolicyConfigurations") + private List networkIntentPolicyConfigurations; + + /** + * Get the name of the service for which subnet is being prepared for. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set 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 name of the resource group where the Network Intent Policy will be stored. + * + * @return the resourceGroupName value + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the name of the resource group where the Network Intent Policy will be stored. + * + * @param resourceGroupName the resourceGroupName value to set + * @return the PrepareNetworkPoliciesRequest object itself. + */ + public PrepareNetworkPoliciesRequest withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get a list of NetworkIntentPolicyConfiguration. + * + * @return the networkIntentPolicyConfigurations value + */ + public List networkIntentPolicyConfigurations() { + return this.networkIntentPolicyConfigurations; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Probe.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Probe.java new file mode 100644 index 0000000000000..bb2972ed8dde6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Probe.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ProbeInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing Probe. + */ +public interface Probe extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the intervalInSeconds value. + */ + Integer intervalInSeconds(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the numberOfProbes value. + */ + Integer numberOfProbes(); + + /** + * @return the port value. + */ + int port(); + + /** + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the requestPath value. + */ + String requestPath(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProbeProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProbeProtocol.java new file mode 100644 index 0000000000000..d7e24cf6a36af --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProbeProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProcessorArchitecture.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProcessorArchitecture.java new file mode 100644 index 0000000000000..9f739f1aaf3b4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProcessorArchitecture.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Protocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Protocol.java new file mode 100644 index 0000000000000..eee4671e4f44b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Protocol.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolConfiguration.java new file mode 100644 index 0000000000000..52731c3e59051 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolConfiguration.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration of the protocol. + */ +public class ProtocolConfiguration { + /** + * HTTP configuration of the connectivity check. + */ + @JsonProperty(value = "HTTPConfiguration") + private HTTPConfiguration hTTPConfiguration; + + /** + * Get hTTP configuration of the connectivity check. + * + * @return the hTTPConfiguration value + */ + public HTTPConfiguration hTTPConfiguration() { + return this.hTTPConfiguration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolCustomSettingsFormat.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolCustomSettingsFormat.java new file mode 100644 index 0000000000000..3a4f59a857a45 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProtocolCustomSettingsFormat.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DDoS custom policy properties. + */ +public class ProtocolCustomSettingsFormat { + /** + * The protocol for which the DDoS protection policy is being customized. + * Possible values include: 'Tcp', 'Udp', 'Syn'. + */ + @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. Possible + * values include: 'Relaxed', 'Low', 'Default', 'High'. + */ + @JsonProperty(value = "triggerSensitivityOverride") + private DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride; + + /** + * Get the protocol for which the DDoS protection policy is being customized. Possible values include: 'Tcp', 'Udp', 'Syn'. + * + * @return the protocol value + */ + public DdosCustomPolicyProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol for which the DDoS protection policy is being customized. Possible values include: 'Tcp', 'Udp', 'Syn'. + * + * @param protocol the protocol value to set + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withProtocol(DdosCustomPolicyProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the customized DDoS protection trigger rate. + * + * @return the triggerRateOverride value + */ + public String triggerRateOverride() { + return this.triggerRateOverride; + } + + /** + * Set 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 customized DDoS protection source rate. + * + * @return the sourceRateOverride value + */ + public String sourceRateOverride() { + return this.sourceRateOverride; + } + + /** + * Set 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 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. Possible values include: 'Relaxed', 'Low', 'Default', 'High'. + * + * @return the triggerSensitivityOverride value + */ + public DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride() { + return this.triggerSensitivityOverride; + } + + /** + * Set 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. Possible values include: 'Relaxed', 'Low', 'Default', 'High'. + * + * @param triggerSensitivityOverride the triggerSensitivityOverride value to set + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withTriggerSensitivityOverride(DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride) { + this.triggerSensitivityOverride = triggerSensitivityOverride; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProvisioningState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProvisioningState.java new file mode 100644 index 0000000000000..ae016841099e3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddress.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddress.java new file mode 100644 index 0000000000000..fb50a97f970af --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddress.java @@ -0,0 +1,452 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PublicIPAddressInner; + +/** + * Type representing PublicIPAddress. + */ +public interface PublicIPAddress extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the ddosSettings value. + */ + DdosSettings ddosSettings(); + + /** + * @return the dnsSettings value. + */ + PublicIPAddressDnsSettings dnsSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the ipConfiguration value. + */ + IPConfiguration ipConfiguration(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the publicIPAllocationMethod value. + */ + IPAllocationMethod publicIPAllocationMethod(); + + /** + * @return the publicIPPrefix value. + */ + SubResource publicIPPrefix(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPAddressSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPAddress definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPAddress definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPAddress definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPAddress definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipaddress definition allowing to specify DdosSettings. + */ + interface WithDdosSettings { + /** + * Specifies ddosSettings. + * @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 DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipaddress definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @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 IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @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 IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP address allocation method. Possible values include: 'Static', 'Dynamic' + * @return the next definition stage + */ + WithCreate withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress definition allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies 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 zones. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDdosSettings, DefinitionStages.WithDnsSettings, DefinitionStages.WithEtag, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithIpAddress, DefinitionStages.WithIpTags, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithPublicIPAllocationMethod, DefinitionStages.WithPublicIPPrefix, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPAddress update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDdosSettings, UpdateStages.WithDnsSettings, UpdateStages.WithEtag, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithIpAddress, UpdateStages.WithIpTags, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithPublicIPAllocationMethod, UpdateStages.WithPublicIPPrefix, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPAddress update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipaddress update allowing to specify DdosSettings. + */ + interface WithDdosSettings { + /** + * Specifies ddosSettings. + * @param ddosSettings The DDoS protection custom policy associated with the public IP address + * @return the next update stage + */ + Update withDdosSettings(DdosSettings ddosSettings); + } + + /** + * The stage of the publicipaddress update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + * @param dnsSettings The FQDN of the DNS record associated with the public IP address + * @return the next update stage + */ + Update withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipaddress update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + * @param idleTimeoutInMinutes The idle timeout of the public IP address + * @return the next update stage + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address associated with the public IP address resource + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP address + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + * @param publicIPAllocationMethod The public IP address allocation method. Possible values include: 'Static', 'Dynamic' + * @return the next update stage + */ + Update withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPPrefix. + */ + interface WithPublicIPPrefix { + /** + * Specifies publicIPPrefix. + * @param publicIPPrefix The Public IP Prefix this Public IP Address should be allocated from + * @return the next update stage + */ + Update withPublicIPPrefix(SubResource publicIPPrefix); + } + + /** + * The stage of the publicipaddress update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP address SKU + * @return the next update stage + */ + Update withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressDnsSettings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressDnsSettings.java new file mode 100644 index 0000000000000..70454f422a528 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressDnsSettings.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains FQDN of the DNS record associated with the public IP address. + */ +public class PublicIPAddressDnsSettings { + /** + * Gets or sets 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; + + /** + * Gets the FQDN, 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; + + /** + * Gets or Sets 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 gets or sets 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 gets or sets 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 gets the FQDN, 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 gets the FQDN, 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 gets or Sets 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 gets or Sets 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSku.java new file mode 100644 index 0000000000000..796a99f9e0f0a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSku.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP address. + */ +public class PublicIPAddressSku { + /** + * Name of a public IP address SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPAddressSkuName name; + + /** + * Get name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public PublicIPAddressSkuName name() { + return this.name; + } + + /** + * Set name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the PublicIPAddressSku object itself. + */ + public PublicIPAddressSku withName(PublicIPAddressSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSkuName.java new file mode 100644 index 0000000000000..f7d2053d48f88 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddressSkuName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddresses.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddresses.java new file mode 100644 index 0000000000000..2af494344c0a5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPAddresses.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PublicIPAddressesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPAddresses. + */ +public interface PublicIPAddresses extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * 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 + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName); + + /** + * 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 + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefix.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefix.java new file mode 100644 index 0000000000000..ad5d5b747882e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefix.java @@ -0,0 +1,359 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PublicIPPrefixInner; + +/** + * Type representing PublicIPPrefix. + */ +public interface PublicIPPrefix extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipPrefix value. + */ + String ipPrefix(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the prefixLength value. + */ + Integer prefixLength(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddresses value. + */ + List publicIPAddresses(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPPrefixSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPPrefix definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPPrefix definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPPrefix definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPPrefix definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipprefix definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next definition stage + */ + WithCreate withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix definition allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @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 prefixLength. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next definition stage + */ + WithCreate withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix definition allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values include: 'IPv4', 'IPv6' + * @return the next definition stage + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies 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 zones. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithIpPrefix, DefinitionStages.WithIpTags, DefinitionStages.WithPrefixLength, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddresses, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPPrefix update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithIpPrefix, UpdateStages.WithIpTags, UpdateStages.WithPrefixLength, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddresses, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPPrefix update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipprefix update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipprefix update allowing to specify IpPrefix. + */ + interface WithIpPrefix { + /** + * Specifies ipPrefix. + * @param ipPrefix The allocated Prefix + * @return the next update stage + */ + Update withIpPrefix(String ipPrefix); + } + + /** + * The stage of the publicipprefix update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + * @param ipTags The list of tags associated with the public IP prefix + * @return the next update stage + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipprefix update allowing to specify PrefixLength. + */ + interface WithPrefixLength { + /** + * Specifies prefixLength. + * @param prefixLength The Length of the Public IP Prefix + * @return the next update stage + */ + Update withPrefixLength(Integer prefixLength); + } + + /** + * The stage of the publicipprefix update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddresses. + */ + interface WithPublicIPAddresses { + /** + * Specifies publicIPAddresses. + * @param publicIPAddresses The list of all referenced PublicIPAddresses + * @return the next update stage + */ + Update withPublicIPAddresses(List publicIPAddresses); + } + + /** + * The stage of the publicipprefix update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + * @param publicIPAddressVersion The public IP address version. Possible values include: 'IPv4', 'IPv6' + * @return the next update stage + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipprefix update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the public IP prefix resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipprefix update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The public IP prefix SKU + * @return the next update stage + */ + Update withSku(PublicIPPrefixSku sku); + } + + /** + * The stage of the publicipprefix update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from + * @return the next update stage + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSku.java new file mode 100644 index 0000000000000..1d362cfdc6bf4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP prefix. + */ +public class PublicIPPrefixSku { + /** + * Name of a public IP prefix SKU. Possible values include: 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPPrefixSkuName name; + + /** + * Get name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @return the name value + */ + public PublicIPPrefixSkuName name() { + return this.name; + } + + /** + * Set name of a public IP prefix SKU. Possible values include: 'Standard'. + * + * @param name the name value to set + * @return the PublicIPPrefixSku object itself. + */ + public PublicIPPrefixSku withName(PublicIPPrefixSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSkuName.java new file mode 100644 index 0000000000000..f310119ad85d5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixSkuName.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixes.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixes.java new file mode 100644 index 0000000000000..24eaa2d4ec0c8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/PublicIPPrefixes.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.PublicIPPrefixesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPPrefixes. + */ +public interface PublicIPPrefixes extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/QueryTroubleshootingParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/QueryTroubleshootingParameters.java new file mode 100644 index 0000000000000..073cfd2e30c22 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/QueryTroubleshootingParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the resource to query the troubleshooting result. + */ +public class QueryTroubleshootingParameters { + /** + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ReferencedPublicIpAddress.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ReferencedPublicIpAddress.java new file mode 100644 index 0000000000000..69491db126083 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ReferencedPublicIpAddress.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Reference to a public IP address. + */ +public class ReferencedPublicIpAddress { + /** + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the PublicIPAddress Reference. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceIdentityType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceIdentityType.java new file mode 100644 index 0000000000000..0e7350a72c495 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceIdentityType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +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 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceNavigationLink.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceNavigationLink.java new file mode 100644 index 0000000000000..60ff78f581441 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ResourceNavigationLink.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ResourceNavigationLink resource. + */ +@JsonFlatten +public class ResourceNavigationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ResourceNavigationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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 resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ResourceNavigationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RetentionPolicyParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RetentionPolicyParameters.java new file mode 100644 index 0000000000000..77bb4f335b724 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RetentionPolicyParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the retention policy for flow log. + */ +public class RetentionPolicyParameters { + /** + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get number of days to retain flow log records. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set 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 flag to enable/disable retention. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Route.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Route.java new file mode 100644 index 0000000000000..51226ef85e472 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Route.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing Route. + */ +public interface Route extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the Route definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteTable, DefinitionStages.WithNextHopType, DefinitionStages.WithCreate { + } + + /** + * Grouping of Route definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Route definition. + */ + interface Blank extends WithRouteTable { + } + + /** + * The stage of the route definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies resourceGroupName, routeTableName. + * @param resourceGroupName The name of the resource group + * @param routeTableName The name of the route table + * @return the next definition stage + */ + WithNextHopType withExistingRouteTable(String resourceGroupName, String routeTableName); + } + + /** + * The stage of the route definition allowing to specify NextHopType. + */ + interface WithNextHopType { + /** + * Specifies nextHopType. + * @param nextHopType The type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' + * @return the next definition stage + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + + /** + * The stage of the route definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the route definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the route definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNextHopIpAddress, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a Route update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNextHopIpAddress, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of Route update stages. + */ + interface UpdateStages { + /** + * The stage of the route update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The destination CIDR to which the route applies + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the route update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the route update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the route update allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + * @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 update stage + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilter.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilter.java new file mode 100644 index 0000000000000..ad481e0673f17 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilter.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterInner; + +/** + * Type representing RouteFilter. + */ +public interface RouteFilter extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rules value. + */ + List rules(); + + /** + * The entirety of the RouteFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilter definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteFilter definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routefilter definition allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next definition stage + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the routefilter definition allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next definition stage + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithPeerings, DefinitionStages.WithRules { + } + } + /** + * The template for a RouteFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithPeerings, UpdateStages.WithRules { + } + + /** + * Grouping of RouteFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilter update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + * @param peerings A collection of references to express route circuit peerings + * @return the next update stage + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the routefilter update allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules Collection of RouteFilterRules contained within a route filter + * @return the next update stage + */ + Update withRules(List rules); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRule.java new file mode 100644 index 0000000000000..08b73351e784a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRule.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing RouteFilterRule. + */ +public interface RouteFilterRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the communities value. + */ + List communities(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilterRuleType value. + */ + String routeFilterRuleType(); + + /** + * The entirety of the RouteFilterRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteFilter, DefinitionStages.WithAccess, DefinitionStages.WithCommunities, DefinitionStages.WithRouteFilterRuleType, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilterRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilterRule definition. + */ + interface Blank extends WithRouteFilter { + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies resourceGroupName, routeFilterName. + * @param resourceGroupName The name of the resource group + * @param routeFilterName The name of the route filter + * @return the next definition stage + */ + WithAccess withExistingRouteFilter(String resourceGroupName, String routeFilterName); + } + + /** + * The stage of the routefilterrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + * @param access The access type of the rule. Possible values include: 'Allow', 'Deny' + * @return the next definition stage + */ + WithCommunities withAccess(Access access); + } + + /** + * The stage of the routefilterrule definition allowing to specify Communities. + */ + interface WithCommunities { + /** + * Specifies communities. + * @param communities The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020'] + * @return the next definition stage + */ + WithRouteFilterRuleType withCommunities(List communities); + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilterRuleType. + */ + interface WithRouteFilterRuleType { + /** + * Specifies routeFilterRuleType. + * @param routeFilterRuleType The rule type of the rule. Valid value is: 'Community' + * @return the next definition stage + */ + WithCreate withRouteFilterRuleType(String routeFilterRuleType); + } + + /** + * The stage of the routefilterrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the routefilterrule definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the routefilterrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a RouteFilterRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId { + } + + /** + * Grouping of RouteFilterRule update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilterrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRules.java new file mode 100644 index 0000000000000..d94a91d155c7b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilterRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFilterRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilterRules. + */ +public interface RouteFilterRules extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * 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 + * @return the observable for the request + */ + Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilters.java new file mode 100644 index 0000000000000..5da29c0859ca4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteFilters.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilters. + */ +public interface RouteFilters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteNextHopType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteNextHopType.java new file mode 100644 index 0000000000000..310a41b3a5d2d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteNextHopType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTable.java new file mode 100644 index 0000000000000..918879d812e2d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTable.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteTableInner; + +/** + * Type representing RouteTable. + */ +public interface RouteTable extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableBgpRoutePropagation value. + */ + Boolean disableBgpRoutePropagation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routes value. + */ + List routes(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the RouteTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteTable definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteTable definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routetable definition allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next definition stage + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the routetable definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable definition allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next definition stage + */ + WithCreate withRoutes(List routes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableBgpRoutePropagation, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithRoutes { + } + } + /** + * The template for a RouteTable update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableBgpRoutePropagation, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithRoutes { + } + + /** + * Grouping of RouteTable update stages. + */ + interface UpdateStages { + /** + * The stage of the routetable update allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + * @param disableBgpRoutePropagation Gets or sets whether to disable the routes learned by BGP on that route table. True means disable + * @return the next update stage + */ + Update withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the routetable update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable update allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + * @param routes Collection of routes contained within a route table + * @return the next update stage + */ + Update withRoutes(List routes); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTables.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTables.java new file mode 100644 index 0000000000000..4dad93e4a43c6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/RouteTables.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteTablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteTables. + */ +public interface RouteTables extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Routes.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Routes.java new file mode 100644 index 0000000000000..d1df67f6361f7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Routes.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RoutesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Routes. + */ +public interface Routes extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String routeTableName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupNetworkInterface.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupNetworkInterface.java new file mode 100644 index 0000000000000..c6b212b8203af --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupNetworkInterface.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and all its associated security rules. + */ +public class SecurityGroupNetworkInterface { + /** + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /** + * All security rules associated with the network interface. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get iD of the network interface. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 all security rules associated with the network interface. + * + * @return the securityRuleAssociations value + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewParameters.java new file mode 100644 index 0000000000000..7390483ec8ddd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the VM to check security groups for. + */ +public class SecurityGroupViewParameters { + /** + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get iD of the target VM. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..70bd01ba6d1f9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityGroupViewResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityGroupViewResultInner; +import java.util.List; + +/** + * Type representing SecurityGroupViewResult. + */ +public interface SecurityGroupViewResult extends HasInner, HasManager { + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAccess.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAccess.java new file mode 100644 index 0000000000000..6612f3f2be243 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAccess.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAssociations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAssociations.java new file mode 100644 index 0000000000000..914a2a3524891 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleAssociations.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * All security rules associated with the network interface. + */ +public class SecurityRuleAssociations { + /** + * Network interface and it's custom security rules. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /** + * Subnet and it's custom security rules. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /** + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /** + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get network interface and it's custom security rules. + * + * @return the networkInterfaceAssociation value + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set 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 subnet and it's custom security rules. + * + * @return the subnetAssociation value + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set 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 collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set 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 collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleDirection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleDirection.java new file mode 100644 index 0000000000000..2f615fac7179a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleDirection.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleProtocol.java new file mode 100644 index 0000000000000..1ed806b7cae99 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRuleProtocol.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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("*"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRules.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRules.java new file mode 100644 index 0000000000000..ef884073a0ae1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SecurityRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SecurityRules. + */ +public interface SecurityRules extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceAssociationLink.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceAssociationLink.java new file mode 100644 index 0000000000000..6e47821583f61 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceAssociationLink.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ServiceAssociationLink resource. + */ +@JsonFlatten +public class ServiceAssociationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ServiceAssociationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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 resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ServiceAssociationLink object itself. + */ + public ServiceAssociationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ServiceAssociationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicies.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..21befe61489e1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicies.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicies. + */ +public interface ServiceEndpointPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicy.java new file mode 100644 index 0000000000000..b28b38700527b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicy.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing ServiceEndpointPolicy. + */ +public interface ServiceEndpointPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the serviceEndpointPolicyDefinitions value. + */ + List serviceEndpointPolicyDefinitions(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the ServiceEndpointPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ServiceEndpointPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy definition allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag, DefinitionStages.WithServiceEndpointPolicyDefinitions { + } + } + /** + * The template for a ServiceEndpointPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithServiceEndpointPolicyDefinitions { + } + + /** + * Grouping of ServiceEndpointPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicy update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicy update allowing to specify ServiceEndpointPolicyDefinitions. + */ + interface WithServiceEndpointPolicyDefinitions { + /** + * Specifies serviceEndpointPolicyDefinitions. + * @param serviceEndpointPolicyDefinitions A collection of service endpoint policy definitions of the service endpoint policy + * @return the next update stage + */ + Update withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinition.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinition.java new file mode 100644 index 0000000000000..112cae634b294 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPolicyDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing ServiceEndpointPolicyDefinition. + */ +public interface ServiceEndpointPolicyDefinition extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the service value. + */ + String service(); + + /** + * @return the serviceResources value. + */ + List serviceResources(); + + /** + * The entirety of the ServiceEndpointPolicyDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServiceEndpointPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServiceEndpointPolicyDefinition definition. + */ + interface Blank extends WithServiceEndpointPolicy { + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify ServiceEndpointPolicy. + */ + interface WithServiceEndpointPolicy { + /** + * 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 allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 Service. + */ + interface WithService { + /** + * Specifies service. + * @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 serviceResources. + * @param serviceResources A list of service resources + * @return the next definition stage + */ + WithCreate withServiceResources(List serviceResources); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithService, DefinitionStages.WithServiceResources { + } + } + /** + * The template for a ServiceEndpointPolicyDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithService, UpdateStages.WithServiceResources { + } + + /** + * Grouping of ServiceEndpointPolicyDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description A description for this rule. Restricted to 140 chars + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify Service. + */ + interface WithService { + /** + * Specifies service. + * @param service Service endpoint name + * @return the next update stage + */ + Update withService(String service); + } + + /** + * The stage of the serviceendpointpolicydefinition update allowing to specify ServiceResources. + */ + interface WithServiceResources { + /** + * Specifies serviceResources. + * @param serviceResources A list of service resources + * @return the next update stage + */ + Update withServiceResources(List serviceResources); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinitions.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinitions.java new file mode 100644 index 0000000000000..3eb5e2670ac87 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPolicyDefinitions.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPolicyDefinitionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServiceEndpointPolicyDefinitions. + */ +public interface ServiceEndpointPolicyDefinitions extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPropertiesFormat.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPropertiesFormat.java new file mode 100644 index 0000000000000..f4d04cc258456 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service endpoint properties. + */ +public class ServiceEndpointPropertiesFormat { + /** + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /** + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Get the type of the endpoint service. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set 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 a list of locations. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set 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 provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceProviderProvisioningState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..8d86c85b9bcf2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/ServiceProviderProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Severity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Severity.java new file mode 100644 index 0000000000000..1da584b3b7e26 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Severity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnet.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnet.java new file mode 100644 index 0000000000000..1c91e493c9bd8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnet.java @@ -0,0 +1,504 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.RouteTableInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ServiceEndpointPolicyInner; + +/** + * Type representing Subnet. + */ +public interface Subnet extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the addressPrefixes value. + */ + List addressPrefixes(); + + /** + * @return the delegations value. + */ + List delegations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interfaceEndpoints value. + */ + List interfaceEndpoints(); + + /** + * @return the ipConfigurationProfiles value. + */ + List ipConfigurationProfiles(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the natGateway value. + */ + SubResource natGateway(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the purpose value. + */ + String purpose(); + + /** + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * @return the serviceAssociationLinks value. + */ + List serviceAssociationLinks(); + + /** + * @return the serviceEndpointPolicies value. + */ + List serviceEndpointPolicies(); + + /** + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * The entirety of the Subnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of Subnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Subnet definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the subnet definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * 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 allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @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 addressPrefixes. + * @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 Delegations. + */ + interface WithDelegations { + /** + * Specifies delegations. + * @param delegations Gets 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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the subnet definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the subnet definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 NatGateway. + */ + interface WithNatGateway { + /** + * Specifies natGateway. + * @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 NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next definition stage + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet definition allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next definition stage + */ + WithCreate withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next definition stage + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet definition allowing to specify ServiceAssociationLinks. + */ + interface WithServiceAssociationLinks { + /** + * Specifies serviceAssociationLinks. + * @param serviceAssociationLinks Gets an array of references to services injecting into this subnet + * @return the next definition stage + */ + WithCreate withServiceAssociationLinks(List serviceAssociationLinks); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @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 ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next definition stage + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddressPrefix, DefinitionStages.WithAddressPrefixes, DefinitionStages.WithDelegations, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNatGateway, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceNavigationLinks, DefinitionStages.WithRouteTable, DefinitionStages.WithServiceAssociationLinks, DefinitionStages.WithServiceEndpointPolicies, DefinitionStages.WithServiceEndpoints { + } + } + /** + * The template for a Subnet update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAddressPrefixes, UpdateStages.WithDelegations, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNatGateway, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithProvisioningState, UpdateStages.WithResourceNavigationLinks, UpdateStages.WithRouteTable, UpdateStages.WithServiceAssociationLinks, UpdateStages.WithServiceEndpointPolicies, UpdateStages.WithServiceEndpoints { + } + + /** + * Grouping of Subnet update stages. + */ + interface UpdateStages { + /** + * The stage of the subnet update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix The address prefix for the subnet + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet update allowing to specify AddressPrefixes. + */ + interface WithAddressPrefixes { + /** + * Specifies addressPrefixes. + * @param addressPrefixes List of address prefixes for the subnet + * @return the next update stage + */ + Update withAddressPrefixes(List addressPrefixes); + } + + /** + * The stage of the subnet update allowing to specify Delegations. + */ + interface WithDelegations { + /** + * Specifies delegations. + * @param delegations Gets an array of references to the delegations on the subnet + * @return the next update stage + */ + Update withDelegations(List delegations); + } + + /** + * The stage of the subnet update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the subnet update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the subnet update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the subnet update allowing to specify NatGateway. + */ + interface WithNatGateway { + /** + * Specifies natGateway. + * @param natGateway Nat gateway associated with this subnet + * @return the next update stage + */ + Update withNatGateway(SubResource natGateway); + } + + /** + * The stage of the subnet update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + * @param networkSecurityGroup The reference of the NetworkSecurityGroup resource + * @return the next update stage + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet update allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + * @param resourceNavigationLinks Gets an array of references to the external resources using subnet + * @return the next update stage + */ + Update withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The reference of the RouteTable resource + * @return the next update stage + */ + Update withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet update allowing to specify ServiceAssociationLinks. + */ + interface WithServiceAssociationLinks { + /** + * Specifies serviceAssociationLinks. + * @param serviceAssociationLinks Gets an array of references to services injecting into this subnet + * @return the next update stage + */ + Update withServiceAssociationLinks(List serviceAssociationLinks); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpointPolicies. + */ + interface WithServiceEndpointPolicies { + /** + * Specifies serviceEndpointPolicies. + * @param serviceEndpointPolicies An array of service endpoint policies + * @return the next update stage + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + * @param serviceEndpoints An array of service endpoints + * @return the next update stage + */ + Update withServiceEndpoints(List serviceEndpoints); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SubnetAssociation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SubnetAssociation.java new file mode 100644 index 0000000000000..38f452dc59f19 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/SubnetAssociation.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subnet and it's custom security rules. + */ +public class SubnetAssociation { + /** + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get subnet ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnets.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnets.java new file mode 100644 index 0000000000000..4882015d05916 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Subnets.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Subnets. + */ +public interface Subnets extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable prepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TagsObject.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TagsObject.java new file mode 100644 index 0000000000000..34e5f94419f32 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TagsObject.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tags object for patch operations. + */ +public class TagsObject { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Topology.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Topology.java new file mode 100644 index 0000000000000..584b34a0da5a9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Topology.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.TopologyInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Topology. + */ +public interface Topology extends HasInner, HasManager { + /** + * @return the createdDateTime value. + */ + DateTime createdDateTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the resources value. + */ + List resources(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyAssociation.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyAssociation.java new file mode 100644 index 0000000000000..ee7e3c66c2b0a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyAssociation.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resources that have an association with the parent resource. + */ +public class TopologyAssociation { + /** + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The association type of the child resource to the parent resource. + * Possible values include: 'Associated', 'Contains'. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get 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 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 ID of the resource that is associated with the parent resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set 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 association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @return the associationType value + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @param associationType the associationType value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyParameters.java new file mode 100644 index 0000000000000..6182e5323faef --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the representation of topology. + */ +public class TopologyParameters { + /** + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /** + * The reference of the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /** + * The reference of the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set 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 reference of the Virtual Network resource. + * + * @return the targetVirtualNetwork value + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the reference of 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 reference of the Subnet resource. + * + * @return the targetSubnet value + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the reference of 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyResource.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyResource.java new file mode 100644 index 0000000000000..f4ab8b7185a76 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TopologyResource.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network resource topology information for the given resource group. + */ +public class TopologyResource { + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 iD of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 holds the associations the resource has with other resources in the resource group. + * + * @return the associations value + */ + public List associations() { + return this.associations; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsConfigurationProperties.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 0000000000000..66f1afdf3e3ac --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsConfigurationProperties.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsConfigurationProperties { + /** + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion", required = true) + private String workspaceRegion; + + /** + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId", required = true) + 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 flag to enable/disable traffic analytics. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set 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 resource guid of the attached workspace. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set 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 location of the attached workspace. + * + * @return the workspaceRegion value + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set 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 resource Id of the attached workspace. + * + * @return the workspaceResourceId value + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsProperties.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsProperties.java new file mode 100644 index 0000000000000..c4a696cd6bf0e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TrafficAnalyticsProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsProperties { + /** + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration", required = true) + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get parameters that define the configuration of traffic analytics. + * + * @return the networkWatcherFlowAnalyticsConfiguration value + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TransportProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TransportProtocol.java new file mode 100644 index 0000000000000..4c576ddab043a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TransportProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingDetails.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingDetails.java new file mode 100644 index 0000000000000..f9872792229cf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingDetails.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information gained from troubleshooting of specified resource. + */ +public class TroubleshootingDetails { + /** + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /** + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id of the get troubleshoot operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 reason type of failure. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set 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 a summary of troubleshooting. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set 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 details on troubleshooting results. + * + * @return the detail value + */ + public String detail() { + return this.detail; + } + + /** + * Set 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 list of recommended actions. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingParameters.java new file mode 100644 index 0000000000000..64d63844c61fd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the resource to troubleshoot. + */ +@JsonFlatten +public class TroubleshootingParameters { + /** + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "properties.storagePath", required = true) + private String storagePath; + + /** + * Get the target resource to troubleshoot. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set 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 ID for the storage account to save the troubleshoot result. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID for the storage account to save the troubleshoot result. + * + * @param storageId the storageId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the path to the blob to save the troubleshoot result in. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the path to the blob to save the troubleshoot result in. + * + * @param storagePath the storagePath value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingRecommendedActions.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingRecommendedActions.java new file mode 100644 index 0000000000000..f26ee4e44ea2b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingRecommendedActions.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommended actions based on discovered issues. + */ +public class TroubleshootingRecommendedActions { + /** + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /** + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /** + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /** + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get iD of the recommended action. + * + * @return the actionId value + */ + public String actionId() { + return this.actionId; + } + + /** + * Set 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 description of recommended actions. + * + * @return the actionText value + */ + public String actionText() { + return this.actionText; + } + + /** + * Set 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 uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set 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 information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingResult.java new file mode 100644 index 0000000000000..c5d58c800120a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TroubleshootingResult.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.TroubleshootingResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing TroubleshootingResult. + */ +public interface TroubleshootingResult extends HasInner, HasManager { + /** + * @return the code value. + */ + String code(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the results value. + */ + List results(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionHealth.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..8d3b154ac8b7e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionHealth.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewayConnection properties. + */ +public class TunnelConnectionHealth { + /** + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /** + * Virtual Network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @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 tunnel name. + * + * @return the tunnel value + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionStatus.java new file mode 100644 index 0000000000000..0bf54cd16921c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/TunnelConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TunnelConnectionStatus. + */ +public final class TunnelConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a TunnelConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding TunnelConnectionStatus + */ + @JsonCreator + public static TunnelConnectionStatus fromString(String name) { + return fromString(name, TunnelConnectionStatus.class); + } + + /** + * @return known TunnelConnectionStatus values + */ + public static Collection values() { + return values(TunnelConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usage.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usage.java new file mode 100644 index 0000000000000..bef4abc27a523 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + long currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + long limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/UsageName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/UsageName.java new file mode 100644 index 0000000000000..43bee39fea3ec --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/UsageName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names. + */ +public class UsageName { + /** + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /** + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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 a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usages.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usages.java new file mode 100644 index 0000000000000..5e72fce545119 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerbosityLevel.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerbosityLevel.java new file mode 100644 index 0000000000000..5f4bf372b7e7c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerbosityLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowParameters.java new file mode 100644 index 0000000000000..b7bd29c5eeb9e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowParameters.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the IP flow to be verified. + */ +public class VerificationIPFlowParameters { + /** + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The direction of the packet represented as a 5-tuple. Possible values + * include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Possible values include: 'TCP', 'UDP'. + */ + @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 ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set 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 of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 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 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 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 local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set 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 remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowResult.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowResult.java new file mode 100644 index 0000000000000..8e360832aab1d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VerificationIPFlowResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VerificationIPFlowResultInner; + +/** + * Type representing VerificationIPFlowResult. + */ +public interface VerificationIPFlowResult extends HasInner, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the ruleName value. + */ + String ruleName(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHub.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHub.java new file mode 100644 index 0000000000000..47fc837ae5da9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHub.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualHubInner; + +/** + * Type representing VirtualHub. + */ +public interface VirtualHub extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGateway value. + */ + SubResource expressRouteGateway(); + + /** + * @return the p2SVpnGateway value. + */ + SubResource p2SVpnGateway(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the routeTable value. + */ + VirtualHubRouteTable routeTable(); + + /** + * @return the virtualNetworkConnections value. + */ + List virtualNetworkConnections(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * @return the vpnGateway value. + */ + SubResource vpnGateway(); + + /** + * The entirety of the VirtualHub definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualHub definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualHub definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualHub definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualhub definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @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 ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies expressRouteGateway. + * @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 P2SVpnGateway. + */ + interface WithP2SVpnGateway { + /** + * Specifies p2SVpnGateway. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @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 VirtualNetworkConnections. + */ + interface WithVirtualNetworkConnections { + /** + * Specifies virtualNetworkConnections. + * @param virtualNetworkConnections List of all vnet connections with this VirtualHub + * @return the next definition stage + */ + WithCreate withVirtualNetworkConnections(List virtualNetworkConnections); + } + + /** + * The stage of the virtualhub definition allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @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 vpnGateway. + * @param vpnGateway The VpnGateway associated with this VirtualHub + * @return the next definition stage + */ + WithCreate withVpnGateway(SubResource vpnGateway); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressPrefix, DefinitionStages.WithExpressRouteGateway, DefinitionStages.WithP2SVpnGateway, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteTable, DefinitionStages.WithVirtualNetworkConnections, DefinitionStages.WithVirtualWan, DefinitionStages.WithVpnGateway { + } + } + /** + * The template for a VirtualHub update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressPrefix, UpdateStages.WithExpressRouteGateway, UpdateStages.WithP2SVpnGateway, UpdateStages.WithProvisioningState, UpdateStages.WithRouteTable, UpdateStages.WithVirtualNetworkConnections, UpdateStages.WithVirtualWan, UpdateStages.WithVpnGateway { + } + + /** + * Grouping of VirtualHub update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualhub update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + * @param addressPrefix Address-prefix for this VirtualHub + * @return the next update stage + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub update allowing to specify ExpressRouteGateway. + */ + interface WithExpressRouteGateway { + /** + * Specifies expressRouteGateway. + * @param expressRouteGateway The expressRouteGateway associated with this VirtualHub + * @return the next update stage + */ + Update withExpressRouteGateway(SubResource expressRouteGateway); + } + + /** + * The stage of the virtualhub update allowing to specify P2SVpnGateway. + */ + interface WithP2SVpnGateway { + /** + * Specifies p2SVpnGateway. + * @param p2SVpnGateway The P2SVpnGateway associated with this VirtualHub + * @return the next update stage + */ + Update withP2SVpnGateway(SubResource p2SVpnGateway); + } + + /** + * The stage of the virtualhub update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + * @param routeTable The routeTable associated with this virtual hub + * @return the next update stage + */ + Update withRouteTable(VirtualHubRouteTable routeTable); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualNetworkConnections. + */ + interface WithVirtualNetworkConnections { + /** + * Specifies virtualNetworkConnections. + * @param virtualNetworkConnections List of all vnet connections with this VirtualHub + * @return the next update stage + */ + Update withVirtualNetworkConnections(List virtualNetworkConnections); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the VirtualHub belongs + * @return the next update stage + */ + Update withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the virtualhub update allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies vpnGateway. + * @param vpnGateway The VpnGateway associated with this VirtualHub + * @return the next update stage + */ + Update withVpnGateway(SubResource vpnGateway); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubId.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubId.java new file mode 100644 index 0000000000000..cd398bcd024b4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubId.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Hub identifier. + */ +public class VirtualHubId { + /** + * The resource URI for the Virtual Hub where the ExpressRoute gateway is + * or will be deployed. The Virtual Hub resource and the ExpressRoute + * gateway resource reside in the same subscription. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRoute.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRoute.java new file mode 100644 index 0000000000000..8127b86a231ba --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRoute.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualHub route. + */ +public class VirtualHubRoute { + /** + * List of all addressPrefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * NextHop ip address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get list of all addressPrefixes. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set 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 nextHop ip address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRouteTable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRouteTable.java new file mode 100644 index 0000000000000..ebd9cf0787f25 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubRouteTable.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualHub route table. + */ +public class VirtualHubRouteTable { + /** + * List of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get list of all routes. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubs.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubs.java new file mode 100644 index 0000000000000..66fdf3061d4d0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualHubs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualHubs. + */ +public interface VirtualHubs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java new file mode 100644 index 0000000000000..727753d599109 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetNetworkInterfaceIPConfiguration. + */ +public interface VirtualMachineScaleSetNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetwork.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetwork.java new file mode 100644 index 0000000000000..6110265bc838b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetwork.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkInner; + +/** + * Type representing VirtualNetwork. + */ +public interface VirtualNetwork extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the ddosProtectionPlan value. + */ + SubResource ddosProtectionPlan(); + + /** + * @return the dhcpOptions value. + */ + DhcpOptions dhcpOptions(); + + /** + * @return the enableDdosProtection value. + */ + Boolean enableDdosProtection(); + + /** + * @return the enableVmProtection value. + */ + Boolean enableVmProtection(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * @return the virtualNetworkPeerings value. + */ + List virtualNetworkPeerings(); + + /** + * The entirety of the VirtualNetwork definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetwork definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetwork definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetwork definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetwork definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @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 DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @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 DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @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 EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @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 enableVmProtection. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork definition allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork definition allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @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 virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next definition stage + */ + WithCreate withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithDdosProtectionPlan, DefinitionStages.WithDhcpOptions, DefinitionStages.WithEnableDdosProtection, DefinitionStages.WithEnableVmProtection, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSubnets, DefinitionStages.WithVirtualNetworkPeerings { + } + } + /** + * The template for a VirtualNetwork update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithDdosProtectionPlan, UpdateStages.WithDhcpOptions, UpdateStages.WithEnableDdosProtection, UpdateStages.WithEnableVmProtection, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSubnets, UpdateStages.WithVirtualNetworkPeerings { + } + + /** + * Grouping of VirtualNetwork update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetwork update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork update allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network + * @return the next update stage + */ + Update withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork update allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network + * @return the next update stage + */ + Update withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + * @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 update stage + */ + Update withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network + * @return the next update stage + */ + Update withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetwork update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed' + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resourceGuid property of the Virtual Network resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork update allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + * @param subnets A list of subnets in a Virtual Network + * @return the next update stage + */ + Update withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork update allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + * @param virtualNetworkPeerings A list of peerings in a Virtual Network + * @return the next update stage + */ + Update withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkConnectionGatewayReference.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 0000000000000..93032346c5ced --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkConnectionGatewayReference.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + */ +public class VirtualNetworkConnectionGatewayReference { + /** + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateway.java new file mode 100644 index 0000000000000..282a1250f9463 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateway.java @@ -0,0 +1,423 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewayInner; + +/** + * Type representing VirtualNetworkGateway. + */ +public interface VirtualNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeActive value. + */ + Boolean activeActive(); + + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the customRoutes value. + */ + AddressSpace customRoutes(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayDefaultSite value. + */ + SubResource gatewayDefaultSite(); + + /** + * @return the gatewayType value. + */ + VirtualNetworkGatewayType gatewayType(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + VirtualNetworkGatewaySku sku(); + + /** + * @return the vpnClientConfiguration value. + */ + VpnClientConfiguration vpnClientConfiguration(); + + /** + * @return the vpnType value. + */ + VpnType vpnType(); + + /** + * The entirety of the VirtualNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next definition stage + */ + WithCreate withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @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 customRoutes. + * @param customRoutes The reference of the address space resource which represents the custom routes address space specified by the 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 EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of 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 GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next definition stage + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of 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 vpnClientConfiguration. + * @param vpnClientConfiguration The reference of 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 VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next definition stage + */ + WithCreate withVpnType(VpnType vpnType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveActive, DefinitionStages.WithBgpSettings, DefinitionStages.WithCustomRoutes, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithGatewayDefaultSite, DefinitionStages.WithGatewayType, DefinitionStages.WithIpConfigurations, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithVpnClientConfiguration, DefinitionStages.WithVpnType { + } + } + /** + * The template for a VirtualNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveActive, UpdateStages.WithBgpSettings, UpdateStages.WithCustomRoutes, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithGatewayDefaultSite, UpdateStages.WithGatewayType, UpdateStages.WithIpConfigurations, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithVpnClientConfiguration, UpdateStages.WithVpnType { + } + + /** + * Grouping of VirtualNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgateway update allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + * @param activeActive ActiveActive flag + * @return the next update stage + */ + Update withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Virtual network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify CustomRoutes. + */ + interface WithCustomRoutes { + /** + * Specifies customRoutes. + * @param customRoutes The reference of the address space resource which represents the custom routes address space specified by the the customer for virtual network gateway and VpnClient + * @return the next update stage + */ + Update withCustomRoutes(AddressSpace customRoutes); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + * @param gatewayDefaultSite The reference of 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 update stage + */ + Update withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + * @param gatewayType The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute' + * @return the next update stage + */ + Update withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + * @param ipConfigurations IP configurations for virtual network gateway + * @return the next update stage + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGateway resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway + * @return the next update stage + */ + Update withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + * @param vpnClientConfiguration The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations + * @return the next update stage + */ + Update withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + * @param vpnType The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' + * @return the next update stage + */ + Update withVpnType(VpnType vpnType); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnection.java new file mode 100644 index 0000000000000..40bcd6ea4c470 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnection.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.LocalNetworkGatewayInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewayInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewayConnectionInner; + +/** + * Type representing VirtualNetworkGatewayConnection. + */ +public interface VirtualNetworkGatewayConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + LocalNetworkGateway localNetworkGateway2(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkGateway virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkGateway virtualNetworkGateway2(); + + /** + * The entirety of the VirtualNetworkGatewayConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithConnectionType, DefinitionStages.WithVirtualNetworkGateway1, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGatewayConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGatewayConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionType. + */ + interface WithConnectionType { + /** + * Specifies connectionType. + * @param connectionType Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + * @return the next definition stage +*/ + WithVirtualNetworkGateway1 withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway1. + */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies virtualNetworkGateway1. + * @param virtualNetworkGateway1 The reference to virtual network gateway resource + * @return the next definition stage +*/ + WithCreate withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next definition stage + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionProtocol. + */ + interface WithConnectionProtocol { + /** + * Specifies connectionProtocol. + * @param connectionProtocol Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next definition stage + */ + WithCreate withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next definition stage + */ + WithCreate withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @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 LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @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 Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @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 ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next definition stage + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @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 VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next definition stage + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithConnectionProtocol, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithExpressRouteGatewayBypass, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocalNetworkGateway2, DefinitionStages.WithPeer, DefinitionStages.WithResourceGuid, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithUsePolicyBasedTrafficSelectors, DefinitionStages.WithVirtualNetworkGateway2 { + } + } + /** + * The template for a VirtualNetworkGatewayConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthorizationKey, UpdateStages.WithConnectionProtocol, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithExpressRouteGatewayBypass, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocalNetworkGateway2, UpdateStages.WithPeer, UpdateStages.WithResourceGuid, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithUsePolicyBasedTrafficSelectors, UpdateStages.WithVirtualNetworkGateway2 { + } + + /** + * Grouping of VirtualNetworkGatewayConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey The authorizationKey + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ConnectionProtocol. + */ + interface WithConnectionProtocol { + /** + * Specifies connectionProtocol. + * @param connectionProtocol Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next update stage + */ + Update withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ExpressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies expressRouteGatewayBypass. + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding + * @return the next update stage + */ + Update withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + * @param localNetworkGateway2 The reference to local network gateway resource + * @return the next update stage + */ + Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + * @param peer The reference to peerings resource + * @return the next update stage + */ + Update withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + * @param resourceGuid The resource GUID property of the VirtualNetworkGatewayConnection resource + * @return the next update stage + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight The routing weight + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey The IPSec shared key + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors + * @return the next update stage + */ + Update withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + * @param virtualNetworkGateway2 The reference to virtual network gateway resource + * @return the next update stage + */ + Update withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionListEntity.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 0000000000000..17d41e305e2de --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionListEntity.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewayConnectionListEntityInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing VirtualNetworkGatewayConnectionListEntity. + */ +public interface VirtualNetworkGatewayConnectionListEntity extends HasInner, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionProtocol value. + */ + VirtualNetworkGatewayConnectionProtocol connectionProtocol(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference localNetworkGateway2(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionProtocol.java new file mode 100644 index 0000000000000..09795b0064083 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 0000000000000..09476f47a544e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 0000000000000..c71b40eae5d79 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnections.java new file mode 100644 index 0000000000000..81a914fbc0085 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayConnections.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2019_02_01.implementation.ConnectionSharedKeyInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewayConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkGatewayConnections. + */ +public interface VirtualNetworkGatewayConnections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * 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 + * @return the observable for the request + */ + Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayIPConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayIPConfiguration.java new file mode 100644 index 0000000000000..26fc778c47cc4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayIPConfiguration.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration for virtual network gateway. + */ +@JsonFlatten +public class VirtualNetworkGatewayIPConfiguration extends SubResource { + /** + * The private IP address allocation method. Possible values include: + * 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySku.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySku.java new file mode 100644 index 0000000000000..cb86ce8772af1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySku.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewaySku details. + */ +public class VirtualNetworkGatewaySku { + /** + * Gateway SKU name. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /** + * Gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /** + * The capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the name value + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param name the name value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the tier value + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @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. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity. + * + * @param capacity the capacity value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuName.java new file mode 100644 index 0000000000000..23631ea5680ef --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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 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 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuTier.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 0000000000000..c81d0fa5db7ed --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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 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 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayType.java new file mode 100644 index 0000000000000..1599c332d03c9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGatewayType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateways.java new file mode 100644 index 0000000000000..68b37431cdc88 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkGateways.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnClientIPsecParametersInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionListEntity; + +/** + * Type representing VirtualNetworkGateways. + */ +public interface VirtualNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable resetAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * 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 + * @return the observable for the request + */ + Observable generatevpnclientpackageAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * 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 + * @return the observable for the request + */ + Observable getVpnProfilePackageUrlAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBgpPeerStatusAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * 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 + * @return the observable for the request + */ + Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * 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 + * @return the observable for the request + */ + Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * 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 + * @return the observable for the request + */ + Observable getVpnclientIpsecParametersAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName); + + /** + * 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 + * @return the observable for the request + */ + Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeering.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeering.java new file mode 100644 index 0000000000000..920ab607359f4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeering.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing VirtualNetworkPeering. + */ +public interface VirtualNetworkPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peeringState value. + */ + VirtualNetworkPeeringState peeringState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * The entirety of the VirtualNetworkPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkPeering definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * 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 allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @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 allowGatewayTransit. + * @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 AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @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 Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next definition stage + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next definition stage + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of 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 UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAllowForwardedTraffic, DefinitionStages.WithAllowGatewayTransit, DefinitionStages.WithAllowVirtualNetworkAccess, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeeringState, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteAddressSpace, DefinitionStages.WithRemoteVirtualNetwork, DefinitionStages.WithUseRemoteGateways { + } + } + /** + * The template for a VirtualNetworkPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllowForwardedTraffic, UpdateStages.WithAllowGatewayTransit, UpdateStages.WithAllowVirtualNetworkAccess, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeeringState, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteAddressSpace, UpdateStages.WithRemoteVirtualNetwork, UpdateStages.WithUseRemoteGateways { + } + + /** + * Grouping of VirtualNetworkPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + * @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 update stage + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this virtual network + * @return the next update stage + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + * @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 update stage + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag A unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + * @param peeringState The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @return the next update stage + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + * @param remoteAddressSpace The reference of the remote virtual network address space + * @return the next update stage + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + * @param remoteVirtualNetwork The reference of 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 update stage + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + * @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 update stage + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeeringState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeeringState.java new file mode 100644 index 0000000000000..ac27b66c436f0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeeringState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeerings.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeerings.java new file mode 100644 index 0000000000000..a4095d0779548 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkPeerings.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkPeerings. + */ +public interface VirtualNetworkPeerings extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTap.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTap.java new file mode 100644 index 0000000000000..b162f02eb14a3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTap.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkTapInner; + +/** + * Type representing VirtualNetworkTap. + */ +public interface VirtualNetworkTap extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the destinationLoadBalancerFrontEndIPConfiguration value. + */ + FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration(); + + /** + * @return the destinationNetworkInterfaceIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration(); + + /** + * @return the destinationPort value. + */ + Integer destinationPort(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaceTapConfigurations value. + */ + List networkInterfaceTapConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the VirtualNetworkTap definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkTap definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkTap definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkTap definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworktap definition allowing to specify DestinationLoadBalancerFrontEndIPConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIPConfiguration { + /** + * Specifies destinationLoadBalancerFrontEndIPConfiguration. + * @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 DestinationNetworkInterfaceIPConfiguration. + */ + interface WithDestinationNetworkInterfaceIPConfiguration { + /** + * Specifies destinationNetworkInterfaceIPConfiguration. + * @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 DestinationPort. + */ + interface WithDestinationPort { + /** + * Specifies destinationPort. + * @param destinationPort The VXLAN destination port that will receive the tapped traffic + * @return the next definition stage + */ + WithCreate withDestinationPort(Integer destinationPort); + } + + /** + * The stage of the virtualnetworktap definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDestinationLoadBalancerFrontEndIPConfiguration, DefinitionStages.WithDestinationNetworkInterfaceIPConfiguration, DefinitionStages.WithDestinationPort, DefinitionStages.WithEtag { + } + } + /** + * The template for a VirtualNetworkTap update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDestinationLoadBalancerFrontEndIPConfiguration, UpdateStages.WithDestinationNetworkInterfaceIPConfiguration, UpdateStages.WithDestinationPort, UpdateStages.WithEtag { + } + + /** + * Grouping of VirtualNetworkTap update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworktap update allowing to specify DestinationLoadBalancerFrontEndIPConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIPConfiguration { + /** + * Specifies destinationLoadBalancerFrontEndIPConfiguration. + * @param destinationLoadBalancerFrontEndIPConfiguration The reference to the private IP address on the internal Load Balancer that will receive the tap + * @return the next update stage + */ + Update withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration); + } + + /** + * The stage of the virtualnetworktap update allowing to specify DestinationNetworkInterfaceIPConfiguration. + */ + interface WithDestinationNetworkInterfaceIPConfiguration { + /** + * Specifies destinationNetworkInterfaceIPConfiguration. + * @param destinationNetworkInterfaceIPConfiguration The reference to the private IP Address of the collector nic that will receive the tap + * @return the next update stage + */ + Update withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration); + } + + /** + * The stage of the virtualnetworktap update allowing to specify DestinationPort. + */ + interface WithDestinationPort { + /** + * Specifies destinationPort. + * @param destinationPort The VXLAN destination port that will receive the tapped traffic + * @return the next update stage + */ + Update withDestinationPort(Integer destinationPort); + } + + /** + * The stage of the virtualnetworktap update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTaps.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTaps.java new file mode 100644 index 0000000000000..b5391563bfea1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkTaps.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkTapsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkTaps. + */ +public interface VirtualNetworkTaps extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsage.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsage.java new file mode 100644 index 0000000000000..8c96668d7f877 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworkUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; + +/** + * Type representing VirtualNetworkUsage. + */ +public interface VirtualNetworkUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsageName.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsageName.java new file mode 100644 index 0000000000000..747b18e838a03 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworkUsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage strings container. + */ +public class VirtualNetworkUsageName { + /** + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get localized subnet size and usage string. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get subnet size and usage string. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworks.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworks.java new file mode 100644 index 0000000000000..39404247bb0f3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualNetworks.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualNetworksInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkUsage; + +/** + * Type representing VirtualNetworks. + */ +public interface VirtualNetworks extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWAN.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWAN.java new file mode 100644 index 0000000000000..7feafe6816d3d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWAN.java @@ -0,0 +1,289 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.P2SVpnServerConfigurationInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualWANInner; + +/** + * Type representing VirtualWAN. + */ +public interface VirtualWAN extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowBranchToBranchTraffic value. + */ + Boolean allowBranchToBranchTraffic(); + + /** + * @return the allowVnetToVnetTraffic value. + */ + Boolean allowVnetToVnetTraffic(); + + /** + * @return the disableVpnEncryption value. + */ + Boolean disableVpnEncryption(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the office365LocalBreakoutCategory value. + */ + OfficeTrafficCategory office365LocalBreakoutCategory(); + + /** + * @return the p2SVpnServerConfigurations value. + */ + List p2SVpnServerConfigurations(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the securityProviderName value. + */ + String securityProviderName(); + + /** + * @return the virtualHubs value. + */ + List virtualHubs(); + + /** + * @return the vpnSites value. + */ + List vpnSites(); + + /** + * The entirety of the VirtualWAN definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualWAN definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualWAN definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualWAN definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualwan definition allowing to specify AllowBranchToBranchTraffic. + */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies allowBranchToBranchTraffic. + * @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 allowVnetToVnetTraffic. + * @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 DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @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 Office365LocalBreakoutCategory. + */ + interface WithOffice365LocalBreakoutCategory { + /** + * Specifies office365LocalBreakoutCategory. + * @param office365LocalBreakoutCategory The office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + * @return the next definition stage + */ + WithCreate withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory); + } + + /** + * The stage of the virtualwan definition allowing to specify P2SVpnServerConfigurations. + */ + interface WithP2SVpnServerConfigurations { + /** + * Specifies p2SVpnServerConfigurations. + * @param p2SVpnServerConfigurations List of all P2SVpnServerConfigurations associated with the virtual wan + * @return the next definition stage + */ + WithCreate withP2SVpnServerConfigurations(List p2SVpnServerConfigurations); + } + + /** + * The stage of the virtualwan definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualwan definition allowing to specify SecurityProviderName. + */ + interface WithSecurityProviderName { + /** + * Specifies securityProviderName. + * @param securityProviderName The Security Provider name + * @return the next definition stage + */ + WithCreate withSecurityProviderName(String securityProviderName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowBranchToBranchTraffic, DefinitionStages.WithAllowVnetToVnetTraffic, DefinitionStages.WithDisableVpnEncryption, DefinitionStages.WithOffice365LocalBreakoutCategory, DefinitionStages.WithP2SVpnServerConfigurations, DefinitionStages.WithProvisioningState, DefinitionStages.WithSecurityProviderName { + } + } + /** + * The template for a VirtualWAN update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowBranchToBranchTraffic, UpdateStages.WithAllowVnetToVnetTraffic, UpdateStages.WithDisableVpnEncryption, UpdateStages.WithOffice365LocalBreakoutCategory, UpdateStages.WithP2SVpnServerConfigurations, UpdateStages.WithProvisioningState, UpdateStages.WithSecurityProviderName { + } + + /** + * Grouping of VirtualWAN update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualwan update allowing to specify AllowBranchToBranchTraffic. + */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies allowBranchToBranchTraffic. + * @param allowBranchToBranchTraffic True if branch to branch traffic is allowed + * @return the next update stage + */ + Update withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + + /** + * The stage of the virtualwan update allowing to specify AllowVnetToVnetTraffic. + */ + interface WithAllowVnetToVnetTraffic { + /** + * Specifies allowVnetToVnetTraffic. + * @param allowVnetToVnetTraffic True if Vnet to Vnet traffic is allowed + * @return the next update stage + */ + Update withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic); + } + + /** + * The stage of the virtualwan update allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + * @param disableVpnEncryption Vpn encryption to be disabled or not + * @return the next update stage + */ + Update withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan update allowing to specify Office365LocalBreakoutCategory. + */ + interface WithOffice365LocalBreakoutCategory { + /** + * Specifies office365LocalBreakoutCategory. + * @param office365LocalBreakoutCategory The office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None' + * @return the next update stage + */ + Update withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory); + } + + /** + * The stage of the virtualwan update allowing to specify P2SVpnServerConfigurations. + */ + interface WithP2SVpnServerConfigurations { + /** + * Specifies p2SVpnServerConfigurations. + * @param p2SVpnServerConfigurations List of all P2SVpnServerConfigurations associated with the virtual wan + * @return the next update stage + */ + Update withP2SVpnServerConfigurations(List p2SVpnServerConfigurations); + } + + /** + * The stage of the virtualwan update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualwan update allowing to specify SecurityProviderName. + */ + interface WithSecurityProviderName { + /** + * Specifies securityProviderName. + * @param securityProviderName The Security Provider name + * @return the next update stage + */ + Update withSecurityProviderName(String securityProviderName); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProvider.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProvider.java new file mode 100644 index 0000000000000..3169a56f616ab --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProvider.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Collection of SecurityProviders. + */ +public class VirtualWanSecurityProvider { + /** + * Name of the security provider. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Url of the security provider. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Name of the security provider. Possible values include: 'External', + * 'Native'. + */ + @JsonProperty(value = "type") + private VirtualWanSecurityProviderType type; + + /** + * Get name of the security provider. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 url of the security provider. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set 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 name of the security provider. Possible values include: 'External', 'Native'. + * + * @return the type value + */ + public VirtualWanSecurityProviderType type() { + return this.type; + } + + /** + * Set name of the security provider. Possible values include: 'External', 'Native'. + * + * @param type the type value to set + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withType(VirtualWanSecurityProviderType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProviderType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProviderType.java new file mode 100644 index 0000000000000..30d17d5874314 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWanSecurityProviderType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWans.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWans.java new file mode 100644 index 0000000000000..9f804f359103a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VirtualWans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VirtualWansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualWans. + */ +public interface VirtualWans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConfiguration.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConfiguration.java new file mode 100644 index 0000000000000..3a811e612b980 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConfiguration.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConfiguration for P2S client. + */ +public class VpnClientConfiguration { + /** + * The reference of 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; + + /** + * 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; + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of 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 vpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set 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 vpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set 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 vpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set 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 vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set 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 radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set 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 radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConnectionHealth.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConnectionHealth.java new file mode 100644 index 0000000000000..6398fffed5a68 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientConnectionHealth.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConnectionHealth properties. + */ +public class VpnClientConnectionHealth { + /** + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIngressBytesTransferred; + + /** + * Total of the Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEgressBytesTransferred; + + /** + * The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + */ + @JsonProperty(value = "vpnClientConnectionsCount") + private Integer vpnClientConnectionsCount; + + /** + * List of allocated ip addresses to the connected p2s vpn clients. + */ + @JsonProperty(value = "allocatedIpAddresses") + private List allocatedIpAddresses; + + /** + * Get total of the Ingress Bytes Transferred in this P2S Vpn connection. + * + * @return the totalIngressBytesTransferred value + */ + public Long totalIngressBytesTransferred() { + return this.totalIngressBytesTransferred; + } + + /** + * Get total of the Egress Bytes Transferred in this connection. + * + * @return the totalEgressBytesTransferred value + */ + public Long totalEgressBytesTransferred() { + return this.totalEgressBytesTransferred; + } + + /** + * Get 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 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 list of allocated ip addresses to the connected p2s vpn clients. + * + * @return the allocatedIpAddresses value + */ + public List allocatedIpAddresses() { + return this.allocatedIpAddresses; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientIPsecParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..29f0b084cbfe8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientIPsecParameters.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnClientIPsecParametersInner; + +/** + * Type representing VpnClientIPsecParameters. + */ +public interface VpnClientIPsecParameters extends HasInner, HasManager { + /** + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientParameters.java new file mode 100644 index 0000000000000..4d237118fce06 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientParameters.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class VpnClientParameters { + /** + * VPN client Processor Architecture. Possible values are: 'AMD64' and + * 'X86'. Possible values include: 'Amd64', 'X86'. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /** + * VPN client authentication method. Possible values include: 'EAPTLS', + * 'EAPMSCHAPv2'. + */ + @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 vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @return the processorArchitecture value + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @param processorArchitecture the processorArchitecture value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get 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 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientProtocol.java new file mode 100644 index 0000000000000..326a07d61c743 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientProtocol.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRevokedCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..7586099c6ac52 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRootCertificate.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRootCertificate.java new file mode 100644 index 0000000000000..7fdc4d6496b4b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the VPN client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnection.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnection.java new file mode 100644 index 0000000000000..ace6d9c666b03 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnection.java @@ -0,0 +1,496 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing VpnConnection. + */ +public interface VpnConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * The entirety of the VpnConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVpnGateway, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnConnection definition. + */ + interface Blank extends WithVpnGateway { + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * 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 vpnconnection definition allowing to specify ConnectionBandwidth. + */ + interface WithConnectionBandwidth { + /** + * Specifies connectionBandwidth. + * @param connectionBandwidth Expected bandwidth in MBPS + * @return the next definition stage + */ + WithCreate withConnectionBandwidth(Integer connectionBandwidth); + } + + /** + * The stage of the vpnconnection definition allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next definition stage + */ + WithCreate withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableInternetSecurity. + */ + interface WithEnableInternetSecurity { + /** + * Specifies enableInternetSecurity. + * @param enableInternetSecurity Enable internet security + * @return the next definition stage + */ + WithCreate withEnableInternetSecurity(Boolean enableInternetSecurity); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableRateLimiting. + */ + interface WithEnableRateLimiting { + /** + * Specifies enableRateLimiting. + * @param enableRateLimiting EnableBgp flag + * @return the next definition stage + */ + WithCreate withEnableRateLimiting(Boolean enableRateLimiting); + } + + /** + * The stage of the vpnconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next definition stage + */ + WithCreate withId(String id); + } + + /** + * The stage of the vpnconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next definition stage + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 vpnconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection definition allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next definition stage + */ + WithCreate withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight Routing weight for vpn connection + * @return the next definition stage + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next definition stage + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection definition allowing to specify UseLocalAzureIpAddress. + */ + interface WithUseLocalAzureIpAddress { + /** + * Specifies useLocalAzureIpAddress. + * @param useLocalAzureIpAddress Use local azure ip to initiate connection + * @return the next definition stage + */ + WithCreate withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress); + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnConnectionProtocolType. + */ + interface WithVpnConnectionProtocolType { + /** + * Specifies vpnConnectionProtocolType. + * @param vpnConnectionProtocolType Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next definition stage + */ + WithCreate withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConnectionBandwidth, DefinitionStages.WithConnectionStatus, DefinitionStages.WithEnableBgp, DefinitionStages.WithEnableInternetSecurity, DefinitionStages.WithEnableRateLimiting, DefinitionStages.WithId, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithName, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteVpnSite, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithUseLocalAzureIpAddress, DefinitionStages.WithVpnConnectionProtocolType { + } + } + /** + * The template for a VpnConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConnectionBandwidth, UpdateStages.WithConnectionStatus, UpdateStages.WithEnableBgp, UpdateStages.WithEnableInternetSecurity, UpdateStages.WithEnableRateLimiting, UpdateStages.WithId, UpdateStages.WithIpsecPolicies, UpdateStages.WithName, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteVpnSite, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithUseLocalAzureIpAddress, UpdateStages.WithVpnConnectionProtocolType { + } + + /** + * Grouping of VpnConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnconnection update allowing to specify ConnectionBandwidth. + */ + interface WithConnectionBandwidth { + /** + * Specifies connectionBandwidth. + * @param connectionBandwidth Expected bandwidth in MBPS + * @return the next update stage + */ + Update withConnectionBandwidth(Integer connectionBandwidth); + } + + /** + * The stage of the vpnconnection update allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + * @param connectionStatus The connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + * @return the next update stage + */ + Update withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + * @param enableBgp EnableBgp flag + * @return the next update stage + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableInternetSecurity. + */ + interface WithEnableInternetSecurity { + /** + * Specifies enableInternetSecurity. + * @param enableInternetSecurity Enable internet security + * @return the next update stage + */ + Update withEnableInternetSecurity(Boolean enableInternetSecurity); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableRateLimiting. + */ + interface WithEnableRateLimiting { + /** + * Specifies enableRateLimiting. + * @param enableRateLimiting EnableBgp flag + * @return the next update stage + */ + Update withEnableRateLimiting(Boolean enableRateLimiting); + } + + /** + * The stage of the vpnconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id Resource ID + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the vpnconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + * @param ipsecPolicies The IPSec Policies to be considered by this connection + * @return the next update stage + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @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 update stage + */ + Update withName(String name); + } + + /** + * The stage of the vpnconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection update allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + * @param remoteVpnSite Id of the connected vpn site + * @return the next update stage + */ + Update withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + * @param routingWeight Routing weight for vpn connection + * @return the next update stage + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + * @param sharedKey SharedKey for the vpn connection + * @return the next update stage + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection update allowing to specify UseLocalAzureIpAddress. + */ + interface WithUseLocalAzureIpAddress { + /** + * Specifies useLocalAzureIpAddress. + * @param useLocalAzureIpAddress Use local azure ip to initiate connection + * @return the next update stage + */ + Update withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress); + } + + /** + * The stage of the vpnconnection update allowing to specify VpnConnectionProtocolType. + */ + interface WithVpnConnectionProtocolType { + /** + * Specifies vpnConnectionProtocolType. + * @param vpnConnectionProtocolType Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + * @return the next update stage + */ + Update withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnectionStatus.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnectionStatus.java new file mode 100644 index 0000000000000..a79b3765e1248 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnections.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnections.java new file mode 100644 index 0000000000000..db47e7091bc73 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnConnections. + */ +public interface VpnConnections extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String gatewayName, String connectionName); + + /** + * 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 + * @return the observable for the request + */ + Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnDeviceScriptParameters.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnDeviceScriptParameters.java new file mode 100644 index 0000000000000..6a02b59c5aca0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnDeviceScriptParameters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn device configuration script generation parameters. + */ +public class VpnDeviceScriptParameters { + /** + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /** + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /** + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor for the vpn device. + * + * @return the vendor value + */ + public String vendor() { + return this.vendor; + } + + /** + * Set 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 device family for the vpn device. + * + * @return the deviceFamily value + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set 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 firmware version for the vpn device. + * + * @return the firmwareVersion value + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateway.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateway.java new file mode 100644 index 0000000000000..e0dbd8a1667ca --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateway.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnConnectionInner; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnGatewayInner; + +/** + * Type representing VpnGateway. + */ +public interface VpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * @return the vpnGatewayScaleUnit value. + */ + Integer vpnGatewayScaleUnit(); + + /** + * The entirety of the VpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpngateway definition allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @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 Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @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 ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway definition allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @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 VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this vpn gateway + * @return the next definition stage + */ + WithCreate withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithConnections, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub, DefinitionStages.WithVpnGatewayScaleUnit { + } + } + /** + * The template for a VpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithConnections, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub, UpdateStages.WithVpnGatewayScaleUnit { + } + + /** + * Grouping of VpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the vpngateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + * @param bgpSettings Local network gateway's BGP speaker settings + * @return the next update stage + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + * @param connections List of all vpn connections to the gateway + * @return the next update stage + */ + Update withConnections(List connections); + } + + /** + * The stage of the vpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + * @param virtualHub The VirtualHub to which the gateway belongs + * @return the next update stage + */ + Update withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the vpngateway update allowing to specify VpnGatewayScaleUnit. + */ + interface WithVpnGatewayScaleUnit { + /** + * Specifies vpnGatewayScaleUnit. + * @param vpnGatewayScaleUnit The scale unit for this vpn gateway + * @return the next update stage + */ + Update withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGatewayTunnelingProtocol.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGatewayTunnelingProtocol.java new file mode 100644 index 0000000000000..b82b9db8e8f54 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGatewayTunnelingProtocol.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateways.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateways.java new file mode 100644 index 0000000000000..16d13ac53c4f9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnGateways. + */ +public interface VpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnProfileResponse.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnProfileResponse.java new file mode 100644 index 0000000000000..b6c60b11b9672 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnProfileResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnProfileResponseInner; + +/** + * Type representing VpnProfileResponse. + */ +public interface VpnProfileResponse extends HasInner, HasManager { + /** + * @return the profileUrl value. + */ + String profileUrl(); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSite.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSite.java new file mode 100644 index 0000000000000..6075d306bad36 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSite.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnSiteInner; + +/** + * Type representing VpnSite. + */ +public interface VpnSite extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the bgpProperties value. + */ + BgpSettings bgpProperties(); + + /** + * @return the deviceProperties value. + */ + DeviceProperties deviceProperties(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the isSecuritySite value. + */ + Boolean isSecuritySite(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the siteKey value. + */ + String siteKey(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * The entirety of the VpnSite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnSite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnSite definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnSite definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpnsite definition allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @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 bgpProperties. + * @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 DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @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 ipAddress. + * @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 IsSecuritySite. + */ + interface WithIsSecuritySite { + /** + * Specifies isSecuritySite. + * @param isSecuritySite IsSecuritySite flag + * @return the next definition stage + */ + WithCreate withIsSecuritySite(Boolean isSecuritySite); + } + + /** + * The stage of the vpnsite definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite definition allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @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 VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the vpnSite belongs + * @return the next definition stage + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithBgpProperties, DefinitionStages.WithDeviceProperties, DefinitionStages.WithIpAddress, DefinitionStages.WithIsSecuritySite, DefinitionStages.WithProvisioningState, DefinitionStages.WithSiteKey, DefinitionStages.WithVirtualWan { + } + } + /** + * The template for a VpnSite update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithBgpProperties, UpdateStages.WithDeviceProperties, UpdateStages.WithIpAddress, UpdateStages.WithIsSecuritySite, UpdateStages.WithProvisioningState, UpdateStages.WithSiteKey, UpdateStages.WithVirtualWan { + } + + /** + * Grouping of VpnSite update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnsite update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + * @param addressSpace The AddressSpace that contains an array of IP address ranges + * @return the next update stage + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite update allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + * @param bgpProperties The set of bgp properties + * @return the next update stage + */ + Update withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite update allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + * @param deviceProperties The device properties + * @return the next update stage + */ + Update withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The ip-address for the vpn-site + * @return the next update stage + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite update allowing to specify IsSecuritySite. + */ + interface WithIsSecuritySite { + /** + * Specifies isSecuritySite. + * @param isSecuritySite IsSecuritySite flag + * @return the next update stage + */ + Update withIsSecuritySite(Boolean isSecuritySite); + } + + /** + * The stage of the vpnsite update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite update allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + * @param siteKey The key for vpn-site that can be used for connections + * @return the next update stage + */ + Update withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + * @param virtualWan The VirtualWAN to which the vpnSite belongs + * @return the next update stage + */ + Update withVirtualWan(SubResource virtualWan); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSiteId.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSiteId.java new file mode 100644 index 0000000000000..8c8720f3c7dae --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSiteId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnSite Resource. + */ +public class VpnSiteId { + /** + * The resource-uri of the vpn-site for which config is to be fetched. + */ + @JsonProperty(value = "vpnSite", access = JsonProperty.Access.WRITE_ONLY) + private String vpnSite; + + /** + * Get the resource-uri of the vpn-site for which config is to be fetched. + * + * @return the vpnSite value + */ + public String vpnSite() { + return this.vpnSite; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSites.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSites.java new file mode 100644 index 0000000000000..3d5d9a21c8400 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSites.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnSitesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSites. + */ +public interface VpnSites extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSitesConfigurations.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSitesConfigurations.java new file mode 100644 index 0000000000000..1f5c6efe4f6b3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnSitesConfigurations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.implementation.VpnSitesConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSitesConfigurations. + */ +public interface VpnSitesConfigurations extends HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request); + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnType.java new file mode 100644 index 0000000000000..6c1fc9afe693d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/VpnType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallAction.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallAction.java new file mode 100644 index 0000000000000..efc1dbbd45328 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallAction.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallCustomRule.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallCustomRule.java new file mode 100644 index 0000000000000..66ee4900fb35d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallCustomRule.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines contents of a web application rule. + */ +public class WebApplicationFirewallCustomRule { + /** + * Gets 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Describes priority of the rule. Rules with a lower value will be + * evaluated before rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /** + * Describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + */ + @JsonProperty(value = "ruleType", required = true) + private WebApplicationFirewallRuleType ruleType; + + /** + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /** + * Type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + */ + @JsonProperty(value = "action", required = true) + private WebApplicationFirewallAction action; + + /** + * Get gets 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 gets 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 gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get describes 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 describes 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 describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + * + * @return the ruleType value + */ + public WebApplicationFirewallRuleType ruleType() { + return this.ruleType; + } + + /** + * Set describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + * + * @param ruleType the ruleType value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRuleType(WebApplicationFirewallRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get list of match conditions. + * + * @return the matchConditions value + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set 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 type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + * + * @return the action value + */ + public WebApplicationFirewallAction action() { + return this.action; + } + + /** + * Set type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + * + * @param action the action value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withAction(WebApplicationFirewallAction action) { + this.action = action; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallEnabledState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallEnabledState.java new file mode 100644 index 0000000000000..aae3fad23e60b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallEnabledState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMatchVariable.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMatchVariable.java new file mode 100644 index 0000000000000..358a8211e8e1f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMatchVariable.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMode.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMode.java new file mode 100644 index 0000000000000..54d0f6bba4b77 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallOperator.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallOperator.java new file mode 100644 index 0000000000000..8d0f7e991edd3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallOperator.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicies.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicies.java new file mode 100644 index 0000000000000..d0a2f63098ddf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicies.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2019_02_01.implementation.WebApplicationFirewallPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WebApplicationFirewallPolicies. + */ +public interface WebApplicationFirewallPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicy.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicy.java new file mode 100644 index 0000000000000..5bb85e7f5ac14 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicy.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2019_02_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.implementation.WebApplicationFirewallPolicyInner; + +/** + * Type representing WebApplicationFirewallPolicy. + */ +public interface WebApplicationFirewallPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationGateways value. + */ + List applicationGateways(); + + /** + * @return the customRules value. + */ + List customRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + WebApplicationFirewallPolicyResourceState resourceState(); + + /** + * The entirety of the WebApplicationFirewallPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of WebApplicationFirewallPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WebApplicationFirewallPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the WebApplicationFirewallPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify CustomRules. + */ + interface WithCustomRules { + /** + * Specifies customRules. + * @param customRules Describes custom rules inside the policy + * @return the next definition stage + */ + WithCreate withCustomRules(List customRules); + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify PolicySettings. + */ + interface WithPolicySettings { + /** + * Specifies policySettings. + * @param policySettings Describes policySettings for policy + * @return the next definition stage + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCustomRules, DefinitionStages.WithEtag, DefinitionStages.WithPolicySettings { + } + } + /** + * The template for a WebApplicationFirewallPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCustomRules, UpdateStages.WithEtag, UpdateStages.WithPolicySettings { + } + + /** + * Grouping of WebApplicationFirewallPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify CustomRules. + */ + interface WithCustomRules { + /** + * Specifies customRules. + * @param customRules Describes custom rules inside the policy + * @return the next update stage + */ + Update withCustomRules(List customRules); + } + + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify PolicySettings. + */ + interface WithPolicySettings { + /** + * Specifies policySettings. + * @param policySettings Describes policySettings for policy + * @return the next update stage + */ + Update withPolicySettings(PolicySettings policySettings); + } + + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicyResourceState.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicyResourceState.java new file mode 100644 index 0000000000000..625b2bf1e47f6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallPolicyResourceState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallRuleType.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallRuleType.java new file mode 100644 index 0000000000000..7c69ef6c3507d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallRuleType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallTransform.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallTransform.java new file mode 100644 index 0000000000000..0d77e02d13e99 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/WebApplicationFirewallTransform.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 0000000000000..d6bc262f7e02b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslProtocol; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class ApplicationGatewayAvailableSslOptionsImpl extends WrapperImpl implements ApplicationGatewayAvailableSslOptions { + private final NetworkManager manager; + ApplicationGatewayAvailableSslOptionsImpl(ApplicationGatewayAvailableSslOptionsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List availableCipherSuites() { + return this.inner().availableCipherSuites(); + } + + @Override + public List availableProtocols() { + return this.inner().availableProtocols(); + } + + @Override + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.inner().defaultPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List predefinedPolicies() { + return this.inner().predefinedPolicies(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java new file mode 100644 index 0000000000000..454bd1f5556f2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayAvailableSslOptionsInner extends Resource { + /** + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "properties.predefinedPolicies") + private List predefinedPolicies; + + /** + * Name of the Ssl predefined policy applied by default to application + * gateway. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "properties.defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /** + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "properties.availableCipherSuites") + private List availableCipherSuites; + + /** + * List of available Ssl protocols. + */ + @JsonProperty(value = "properties.availableProtocols") + private List availableProtocols; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of available Ssl predefined policy. + * + * @return the predefinedPolicies value + */ + public List predefinedPolicies() { + return this.predefinedPolicies; + } + + /** + * Set list of available Ssl predefined policy. + * + * @param predefinedPolicies the predefinedPolicies value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { + this.predefinedPolicies = predefinedPolicies; + return this; + } + + /** + * Get name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the defaultPolicy value + */ + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.defaultPolicy; + } + + /** + * Set name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param defaultPolicy the defaultPolicy value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { + this.defaultPolicy = defaultPolicy; + return this; + } + + /** + * Get list of available Ssl cipher suites. + * + * @return the availableCipherSuites value + */ + public List availableCipherSuites() { + return this.availableCipherSuites; + } + + /** + * Set list of available Ssl cipher suites. + * + * @param availableCipherSuites the availableCipherSuites value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites(List availableCipherSuites) { + this.availableCipherSuites = availableCipherSuites; + return this; + } + + /** + * Get list of available Ssl protocols. + * + * @return the availableProtocols value + */ + public List availableProtocols() { + return this.availableProtocols; + } + + /** + * Set list of available Ssl protocols. + * + * @param availableProtocols the availableProtocols value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols(List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java new file mode 100644 index 0000000000000..b83cd19a85ad3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFirewallRuleSet; + +class ApplicationGatewayAvailableWafRuleSetsResultImpl extends WrapperImpl implements ApplicationGatewayAvailableWafRuleSetsResult { + private final NetworkManager manager; + ApplicationGatewayAvailableWafRuleSetsResultImpl(ApplicationGatewayAvailableWafRuleSetsResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java new file mode 100644 index 0000000000000..a6ae9cad9cb4d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + */ +public class ApplicationGatewayAvailableWafRuleSetsResultInner { + /** + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of application gateway rule sets. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 0000000000000..ed277f9dbda4e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthPool; + +class ApplicationGatewayBackendHealthImpl extends WrapperImpl implements ApplicationGatewayBackendHealth { + private final NetworkManager manager; + ApplicationGatewayBackendHealthImpl(ApplicationGatewayBackendHealthInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthInner.java new file mode 100644 index 0000000000000..1367f972a9c63 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ApplicationGatewayBackendHealth API service call. + */ +public class ApplicationGatewayBackendHealthInner { + /** + * A list of ApplicationGatewayBackendHealthPool resources. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get a list of ApplicationGatewayBackendHealthPool resources. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java new file mode 100644 index 0000000000000..5c63f2cbb197b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthOnDemand; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthHttpSettings; + +class ApplicationGatewayBackendHealthOnDemandImpl extends WrapperImpl implements ApplicationGatewayBackendHealthOnDemand { + private final NetworkManager manager; + ApplicationGatewayBackendHealthOnDemandImpl(ApplicationGatewayBackendHealthOnDemandInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.inner().backendHealthHttpSettings(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandInner.java new file mode 100644 index 0000000000000..1f50d9561987f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayBackendHealthOnDemandInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthHttpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of on demand test probe. + */ +public class ApplicationGatewayBackendHealthOnDemandInner { + /** + * Reference of an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /** + * Application gateway BackendHealthHttp settings. + */ + @JsonProperty(value = "backendHealthHttpSettings") + private ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings; + + /** + * Get reference of an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set reference of 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 application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value + */ + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.backendHealthHttpSettings; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayImpl.java new file mode 100644 index 0000000000000..6f89ff7fd589b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,371 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayTrustedRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRewriteRuleSet; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAutoscaleConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayCustomError; +import com.microsoft.azure.management.network.v2019_02_01.ManagedServiceIdentity; + +class ApplicationGatewayImpl extends GroupableResourceCoreImpl implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { + ApplicationGatewayImpl(String name, ApplicationGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List authenticationCertificates() { + return this.inner().authenticationCertificates(); + } + + @Override + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.inner().autoscaleConfiguration(); + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + + @Override + public List backendHttpSettingsCollection() { + return this.inner().backendHttpSettingsCollection(); + } + + @Override + public List customErrorConfigurations() { + return this.inner().customErrorConfigurations(); + } + + @Override + public Boolean enableFips() { + return this.inner().enableFips(); + } + + @Override + public Boolean enableHttp2() { + return this.inner().enableHttp2(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource firewallPolicy() { + return this.inner().firewallPolicy(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public List frontendPorts() { + return this.inner().frontendPorts(); + } + + @Override + public List gatewayIPConfigurations() { + return this.inner().gatewayIPConfigurations(); + } + + @Override + public List httpListeners() { + return this.inner().httpListeners(); + } + + @Override + public ManagedServiceIdentity identity() { + return this.inner().identity(); + } + + @Override + public ApplicationGatewayOperationalState operationalState() { + return this.inner().operationalState(); + } + + @Override + public List probes() { + return this.inner().probes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List redirectConfigurations() { + return this.inner().redirectConfigurations(); + } + + @Override + public List requestRoutingRules() { + return this.inner().requestRoutingRules(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List rewriteRuleSets() { + return this.inner().rewriteRuleSets(); + } + + @Override + public ApplicationGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public List sslCertificates() { + return this.inner().sslCertificates(); + } + + @Override + public ApplicationGatewaySslPolicy sslPolicy() { + return this.inner().sslPolicy(); + } + + @Override + public List trustedRootCertificates() { + return this.inner().trustedRootCertificates(); + } + + @Override + public List urlPathMaps() { + return this.inner().urlPathMaps(); + } + + @Override + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.inner().webApplicationFirewallConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ApplicationGatewayImpl withAuthenticationCertificates(List authenticationCertificates) { + this.inner().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.inner().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.inner().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + @Override + public ApplicationGatewayImpl withCustomErrorConfigurations(List customErrorConfigurations) { + this.inner().withCustomErrorConfigurations(customErrorConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.inner().withEnableFips(enableFips); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.inner().withEnableHttp2(enableHttp2); + return this; + } + + @Override + public ApplicationGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationGatewayImpl withFirewallPolicy(SubResource firewallPolicy) { + this.inner().withFirewallPolicy(firewallPolicy); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.inner().withFrontendPorts(frontendPorts); + return this; + } + + @Override + public ApplicationGatewayImpl withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.inner().withGatewayIPConfigurations(gatewayIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.inner().withHttpListeners(httpListeners); + return this; + } + + @Override + public ApplicationGatewayImpl withIdentity(ManagedServiceIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ApplicationGatewayImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public ApplicationGatewayImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ApplicationGatewayImpl withRedirectConfigurations(List redirectConfigurations) { + this.inner().withRedirectConfigurations(redirectConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withRequestRoutingRules(List requestRoutingRules) { + this.inner().withRequestRoutingRules(requestRoutingRules); + return this; + } + + @Override + public ApplicationGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public ApplicationGatewayImpl withRewriteRuleSets(List rewriteRuleSets) { + this.inner().withRewriteRuleSets(rewriteRuleSets); + return this; + } + + @Override + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.inner().withSslCertificates(sslCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.inner().withSslPolicy(sslPolicy); + return this; + } + + @Override + public ApplicationGatewayImpl withTrustedRootCertificates(List trustedRootCertificates) { + this.inner().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.inner().withUrlPathMaps(urlPathMaps); + return this; + } + + @Override + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.inner().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayInner.java new file mode 100644 index 0000000000000..71ef17a5a729b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewayInner.java @@ -0,0 +1,813 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayTrustedRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRewriteRuleSet; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAutoscaleConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayCustomError; +import com.microsoft.azure.management.network.v2019_02_01.ManagedServiceIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Application gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayInner extends Resource { + /** + * SKU of the application gateway resource. + */ + @JsonProperty(value = "properties.sku") + private ApplicationGatewaySku sku; + + /** + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /** + * Operational state of the application gateway resource. Possible values + * include: 'Stopped', 'Starting', 'Running', 'Stopping'. + */ + @JsonProperty(value = "properties.operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /** + * Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.gatewayIPConfigurations") + private List gatewayIPConfigurations; + + /** + * Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.trustedRootCertificates") + private List trustedRootCertificates; + + /** + * SSL certificates of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.sslCertificates") + private List sslCertificates; + + /** + * Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Frontend ports of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.frontendPorts") + private List frontendPorts; + + /** + * Probes of the application gateway resource. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Backend http settings of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Http listeners of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.httpListeners") + private List httpListeners; + + /** + * URL path map of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Rewrite rules for the application gateway resource. + */ + @JsonProperty(value = "properties.rewriteRuleSets") + private List rewriteRuleSets; + + /** + * Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + */ + @JsonProperty(value = "properties.redirectConfigurations") + private List redirectConfigurations; + + /** + * Web application firewall configuration. + */ + @JsonProperty(value = "properties.webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /** + * Reference of the FirewallPolicy resource. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + + /** + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableHttp2") + private Boolean enableHttp2; + + /** + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableFips") + private Boolean enableFips; + + /** + * Autoscale Configuration. + */ + @JsonProperty(value = "properties.autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /** + * Resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Provisioning state of the application gateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Custom error configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.customErrorConfigurations") + private List customErrorConfigurations; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + 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 sKU of the application gateway resource. + * + * @return the sku value + */ + public ApplicationGatewaySku sku() { + return this.sku; + } + + /** + * Set sKU of the application gateway resource. + * + * @param sku the sku value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get sSL policy of the application gateway resource. + * + * @return the sslPolicy value + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set sSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'. + * + * @return the operationalState value + */ + public ApplicationGatewayOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get 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 subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param gatewayIPConfigurations the gatewayIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.gatewayIPConfigurations = gatewayIPConfigurations; + return this; + } + + /** + * Get 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 authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get 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 trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param trustedRootCertificates the trustedRootCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withTrustedRootCertificates(List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get 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 sSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param sslCertificates the sslCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslCertificates(List sslCertificates) { + this.sslCertificates = sslCertificates; + return this; + } + + /** + * Get 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 frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get 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 frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param frontendPorts the frontendPorts value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { + this.frontendPorts = frontendPorts; + return this; + } + + /** + * Get probes of the application gateway resource. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set probes of the application gateway resource. + * + * @param probes the probes value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get 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 backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get 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 backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get 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 http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param httpListeners the httpListeners value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get 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 uRL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing rules of the application gateway resource. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get rewrite rules for the application gateway resource. + * + * @return the rewriteRuleSets value + */ + public List rewriteRuleSets() { + return this.rewriteRuleSets; + } + + /** + * Set rewrite rules for the application gateway resource. + * + * @param rewriteRuleSets the rewriteRuleSets value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRewriteRuleSets(List rewriteRuleSets) { + this.rewriteRuleSets = rewriteRuleSets; + return this; + } + + /** + * Get 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 redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @param redirectConfigurations the redirectConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRedirectConfigurations(List redirectConfigurations) { + this.redirectConfigurations = redirectConfigurations; + return this; + } + + /** + * Get web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.webApplicationFirewallConfiguration; + } + + /** + * Set web application firewall configuration. + * + * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + return this; + } + + /** + * Get reference of the FirewallPolicy resource. + * + * @return the firewallPolicy value + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set reference of the FirewallPolicy resource. + * + * @param firewallPolicy the firewallPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Get whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value + */ + public Boolean enableHttp2() { + return this.enableHttp2; + } + + /** + * Set whether HTTP2 is enabled on the application gateway resource. + * + * @param enableHttp2 the enableHttp2 value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { + this.enableHttp2 = enableHttp2; + return this; + } + + /** + * Get whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set whether FIPS is enabled on the application gateway resource. + * + * @param enableFips the enableFips value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get autoscale Configuration. + * + * @return the autoscaleConfiguration value + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get resource GUID property of the application gateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set resource GUID property of the application gateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value + */ + public List customErrorConfigurations() { + return this.customErrorConfigurations; + } + + /** + * Set custom error configurations of the application gateway resource. + * + * @param customErrorConfigurations the customErrorConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withCustomErrorConfigurations(List customErrorConfigurations) { + this.customErrorConfigurations = customErrorConfigurations; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting where the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set 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 of the application gateway, if configured. + * + * @return the identity value + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set 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 resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..ab0b2c36153c2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPredefinedPolicy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslProtocol; + +class ApplicationGatewaySslPredefinedPolicyImpl extends WrapperImpl implements ApplicationGatewaySslPredefinedPolicy { + private final NetworkManager manager; + ApplicationGatewaySslPredefinedPolicyImpl(ApplicationGatewaySslPredefinedPolicyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List cipherSuites() { + return this.inner().cipherSuites(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.inner().minProtocolVersion(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java new file mode 100644 index 0000000000000..7bc312456fd45 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * An Ssl predefined policy. + */ +@JsonFlatten +public class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /** + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Ssl cipher suites to be enabled in the specified order for application + * gateway. + */ + @JsonProperty(value = "properties.cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "properties.minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get name of the Ssl predefined policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order for application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysImpl.java new file mode 100644 index 0000000000000..4d2ce434d35a6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendHealthOnDemand; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayOnDemandProbe; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewaySslPredefinedPolicy; + +class ApplicationGatewaysImpl extends GroupableResourcesCoreImpl implements ApplicationGateways { + protected ApplicationGatewaysImpl(NetworkManager manager) { + super(manager.inner().applicationGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listAll()); + } + + @Override + public Observable listAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAllAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable startAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.startAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.stopAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.backendHealthAsync(resourceGroupName, applicationGatewayName) + .map(new Func1() { + @Override + public ApplicationGatewayBackendHealth call(ApplicationGatewayBackendHealthInner inner) { + return new ApplicationGatewayBackendHealthImpl(inner, manager()); + } + }); + } + + @Override + public Observable backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + ApplicationGatewaysInner client = this.inner(); + return client.backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest) + .map(new Func1() { + @Override + public ApplicationGatewayBackendHealthOnDemand call(ApplicationGatewayBackendHealthOnDemandInner inner) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableServerVariablesAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableServerVariablesAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + });} + + @Override + public Observable listAvailableRequestHeadersAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableRequestHeadersAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + });} + + @Override + public Observable listAvailableResponseHeadersAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableResponseHeadersAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + });} + + @Override + public Observable listAvailableWafRuleSetsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableWafRuleSetsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResult call(ApplicationGatewayAvailableWafRuleSetsResultInner inner) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, manager()); + } + }); + } + + @Override + protected ApplicationGatewayImpl wrapModel(ApplicationGatewayInner inner) { + return new ApplicationGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationGatewayImpl wrapModel(String name) { + return new ApplicationGatewayImpl(name, new ApplicationGatewayInner(), this.manager()); + } + + @Override + public Observable listAvailableSslOptionsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslOptionsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableSslOptions call(ApplicationGatewayAvailableSslOptionsInner inner) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableSslPredefinedPoliciesAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslPredefinedPoliciesAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + ApplicationGatewaysInner client = this.inner(); + return client.getSslPredefinedPolicyAsync(predefinedPolicyName) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysInner.java new file mode 100644 index 0000000000000..c89bbcd480757 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationGatewaysInner.java @@ -0,0 +1,2928 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayOnDemandProbe; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationGateways. + */ +public class ApplicationGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ApplicationGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAll" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + Observable> listAll(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways backendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> backendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginBackendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> beginBackendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways backendHealthOnDemand" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand") + Observable> backendHealthOnDemand(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Body ApplicationGatewayOnDemandProbe probeRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways beginBackendHealthOnDemand" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand") + Observable> beginBackendHealthOnDemand(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Body ApplicationGatewayOnDemandProbe probeRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableServerVariables" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables") + Observable> listAvailableServerVariables(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableRequestHeaders" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders") + Observable> listAvailableRequestHeaders(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableResponseHeaders" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders") + Observable> listAvailableResponseHeaders(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableWafRuleSets" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + Observable> listAvailableWafRuleSets(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableSslOptions" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + Observable> listAvailableSslOptions(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableSslPredefinedPolicies" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies") + Observable> listAvailableSslPredefinedPolicies(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways getSslPredefinedPolicy" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}") + Observable> getSslPredefinedPolicy(@Path("subscriptionId") String subscriptionId, @Path("predefinedPolicyName") String predefinedPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAllNext" }) + @GET + Observable> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways listAvailableSslPredefinedPoliciesNext" }) + @GET + Observable> listAvailableSslPredefinedPoliciesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified application gateway tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified application gateway tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAll() { + ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { + return listAllSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String applicationGatewayName) { + startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String applicationGatewayName) { + return startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.start(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String applicationGatewayName) { + beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginStart(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String applicationGatewayName) { + stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String applicationGatewayName) { + return stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.stop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String applicationGatewayName) { + beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginStop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBackendHealthDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthOnDemandInner object if successful. + */ + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + return backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + return backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest).map(new Func1, ApplicationGatewayBackendHealthOnDemandInner>() { + @Override + public ApplicationGatewayBackendHealthOnDemandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> backendHealthOnDemandWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (probeRequest == null) { + throw new IllegalArgumentException("Parameter probeRequest is required and cannot be null."); + } + Validator.validate(probeRequest); + final String apiVersion = "2019-02-01"; + final String expand = null; + Observable> observable = service.backendHealthOnDemand(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, probeRequest, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthOnDemandInner object if successful. + */ + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable backendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return backendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).map(new Func1, ApplicationGatewayBackendHealthOnDemandInner>() { + @Override + public ApplicationGatewayBackendHealthOnDemandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> backendHealthOnDemandWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (probeRequest == null) { + throw new IllegalArgumentException("Parameter probeRequest is required and cannot be null."); + } + Validator.validate(probeRequest); + final String apiVersion = "2019-02-01"; + Observable> observable = service.backendHealthOnDemand(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, probeRequest, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthOnDemandInner object if successful. + */ + public ApplicationGatewayBackendHealthOnDemandInner beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + return beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthOnDemandInner object + */ + public Observable beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + return beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest).map(new Func1, ApplicationGatewayBackendHealthOnDemandInner>() { + @Override + public ApplicationGatewayBackendHealthOnDemandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthOnDemandInner object + */ + public Observable> beginBackendHealthOnDemandWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (probeRequest == null) { + throw new IllegalArgumentException("Parameter probeRequest is required and cannot be null."); + } + Validator.validate(probeRequest); + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.beginBackendHealthOnDemand(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, probeRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthOnDemandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthOnDemandInner object if successful. + */ + public ApplicationGatewayBackendHealthOnDemandInner beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthOnDemandInner object + */ + public Observable beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return beginBackendHealthOnDemandWithServiceResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).map(new Func1, ApplicationGatewayBackendHealthOnDemandInner>() { + @Override + public ApplicationGatewayBackendHealthOnDemandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationGatewayBackendHealthOnDemandInner object + */ + public Observable> beginBackendHealthOnDemandWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (probeRequest == null) { + throw new IllegalArgumentException("Parameter probeRequest is required and cannot be null."); + } + Validator.validate(probeRequest); + final String apiVersion = "2019-02-01"; + return service.beginBackendHealthOnDemand(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, probeRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthOnDemandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBackendHealthOnDemandDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available server variables. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<String> object if successful. + */ + public List listAvailableServerVariables() { + return listAvailableServerVariablesWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available server variables. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableServerVariablesAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listAvailableServerVariablesWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available server variables. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> listAvailableServerVariablesAsync() { + return listAvailableServerVariablesWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all available server variables. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> listAvailableServerVariablesWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableServerVariables(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listAvailableServerVariablesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableServerVariablesDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all available request headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<String> object if successful. + */ + public List listAvailableRequestHeaders() { + return listAvailableRequestHeadersWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available request headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableRequestHeadersAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listAvailableRequestHeadersWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available request headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> listAvailableRequestHeadersAsync() { + return listAvailableRequestHeadersWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all available request headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> listAvailableRequestHeadersWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableRequestHeaders(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listAvailableRequestHeadersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableRequestHeadersDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all available response headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<String> object if successful. + */ + public List listAvailableResponseHeaders() { + return listAvailableResponseHeadersWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available response headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableResponseHeadersAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listAvailableResponseHeadersWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available response headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> listAvailableResponseHeadersAsync() { + return listAvailableResponseHeadersWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all available response headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> listAvailableResponseHeadersWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableResponseHeaders(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listAvailableResponseHeadersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableResponseHeadersDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object if successful. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableWafRuleSetsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableWafRuleSetsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableWafRuleSetsResultInner>() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable> listAvailableWafRuleSetsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableWafRuleSets(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableWafRuleSetsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableWafRuleSetsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableSslOptionsInner object if successful. + */ + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableSslOptionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableSslOptionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableSslOptionsInner>() { + @Override + public ApplicationGatewayAvailableSslOptionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable> listAvailableSslOptionsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableSslOptions(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableSslOptionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableSslOptionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPolicies() { + ServiceResponse> response = listAvailableSslPredefinedPoliciesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesAsync() { + return listAvailableSslPredefinedPoliciesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesWithServiceResponseAsync() { + return listAvailableSslPredefinedPoliciesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listAvailableSslPredefinedPolicies(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewaySslPredefinedPolicyInner object if successful. + */ + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).toBlocking().single().body(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSslPredefinedPolicyAsync(String predefinedPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName), serviceCallback); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).map(new Func1, ApplicationGatewaySslPredefinedPolicyInner>() { + @Override + public ApplicationGatewaySslPredefinedPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable> getSslPredefinedPolicyWithServiceResponseAsync(String predefinedPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (predefinedPolicyName == null) { + throw new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getSslPredefinedPolicy(this.client.subscriptionId(), predefinedPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSslPredefinedPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSslPredefinedPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAllNext(final String nextPageLink) { + ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPoliciesNext(final String nextPageLink) { + ServiceResponse> response = listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAvailableSslPredefinedPoliciesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..3dbb14a0bed32 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; +import rx.Observable; + +class ApplicationSecurityGroupImpl extends GroupableResourceCoreImpl implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + ApplicationSecurityGroupImpl(String name, ApplicationSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupInner.java new file mode 100644 index 0000000000000..547e6fa551fd3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An application security group in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationSecurityGroupInner extends Resource { + /** + * The resource GUID property of the application security group resource. + * It uniquely identifies a resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the application security group resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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 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 provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsImpl.java new file mode 100644 index 0000000000000..c267abb9c9e88 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ApplicationSecurityGroupsImpl extends GroupableResourcesCoreImpl implements ApplicationSecurityGroups { + protected ApplicationSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().applicationSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(ApplicationSecurityGroupInner inner) { + return new ApplicationSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(String name) { + return new ApplicationSecurityGroupImpl(name, new ApplicationSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsInner.java new file mode 100644 index 0000000000000..84b980d8d914e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ApplicationSecurityGroupsInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationSecurityGroups. + */ +public class ApplicationSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an application security group's tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner updateTags(String resourceGroupName, String applicationSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Updates an application security group's tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an application security group's tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner updateTags(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags).toBlocking().last().body(); + } + + /** + * 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 tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags), serviceCallback); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an application security group's tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginUpdateTags(String resourceGroupName, String applicationSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Updates an application security group's tags. + * + * @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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an application security group's tags. + * + * @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 + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginUpdateTags(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags).toBlocking().single().body(); + } + + /** + * 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 tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags), serviceCallback); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, tags).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationInner.java new file mode 100644 index 0000000000000..44fbd371944e5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationInner.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The serviceName of an AvailableDelegation indicates a possible delegation + * for a subnet. + */ +public class AvailableDelegationInner { + /** + * The name of the AvailableDelegation resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique identifier of the AvailableDelegation resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The name of the service and resource. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * Describes the actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the name of the AvailableDelegation resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 a unique identifier of the AvailableDelegation resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set 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 name of the service and resource. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set 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 describes the actions permitted to the service upon delegation. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set describes 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsImpl.java new file mode 100644 index 0000000000000..e5aebebe0c377 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.AvailableDelegations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.LocationAvailableDelegation; + +class AvailableDelegationsImpl extends WrapperImpl implements AvailableDelegations { + private final NetworkManager manager; + + AvailableDelegationsImpl(NetworkManager manager) { + super(manager.inner().availableDelegations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LocationAvailableDelegationImpl wrapModel(AvailableDelegationInner inner) { + return new LocationAvailableDelegationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableDelegationsInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocationAvailableDelegation call(AvailableDelegationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsInner.java new file mode 100644 index 0000000000000..2b42fee68e5ac --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableDelegationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableDelegations. + */ +public class AvailableDelegationsInner { + /** The Retrofit service to perform REST calls. */ + private AvailableDelegationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableDelegationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableDelegationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableDelegationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableDelegations to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableDelegationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableDelegations list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableDelegations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + ServiceResponse> * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesImpl.java new file mode 100644 index 0000000000000..9c79dbcf9ae18 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.AvailableEndpointServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.EndpointServiceResult; + +class AvailableEndpointServicesImpl extends WrapperImpl implements AvailableEndpointServices { + private final NetworkManager manager; + + AvailableEndpointServicesImpl(NetworkManager manager) { + super(manager.inner().availableEndpointServices()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private EndpointServiceResultImpl wrapEndpointServiceResultModel(EndpointServiceResultInner inner) { + return new EndpointServiceResultImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableEndpointServicesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EndpointServiceResult call(EndpointServiceResultInner inner) { + return wrapEndpointServiceResultModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesInner.java new file mode 100644 index 0000000000000..6cd79728aa07c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableEndpointServicesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableEndpointServices. + */ +public class AvailableEndpointServicesInner { + /** The Retrofit service to perform REST calls. */ + private AvailableEndpointServicesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableEndpointServicesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableEndpointServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableEndpointServices to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableEndpointServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableEndpointServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableEndpointServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..5a23dadd5fdbb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersListCountry; + +class AvailableProvidersListImpl extends WrapperImpl implements AvailableProvidersList { + private final NetworkManager manager; + AvailableProvidersListImpl(AvailableProvidersListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List countries() { + return this.inner().countries(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListInner.java new file mode 100644 index 0000000000000..7611ceb12a474 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableProvidersListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of available countries with details. + */ +public class AvailableProvidersListInner { + /** + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get list of available countries. + * + * @return the countries value + */ + public List countries() { + return this.countries; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsImpl.java new file mode 100644 index 0000000000000..c3bf13b4748aa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.AvailableResourceGroupDelegations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.LocationAvailableDelegationModel; + +class AvailableResourceGroupDelegationsImpl extends WrapperImpl implements AvailableResourceGroupDelegations { + private final NetworkManager manager; + + AvailableResourceGroupDelegationsImpl(NetworkManager manager) { + super(manager.inner().availableResourceGroupDelegations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LocationAvailableDelegationModelImpl wrapLocationAvailableDelegationModelModel(AvailableDelegationInner inner) { + return new LocationAvailableDelegationModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location, final String resourceGroupName) { + AvailableResourceGroupDelegationsInner client = this.inner(); + return client.listAsync(location, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocationAvailableDelegationModel call(AvailableDelegationInner inner) { + return wrapLocationAvailableDelegationModelModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsInner.java new file mode 100644 index 0000000000000..0f1ba097772d8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AvailableResourceGroupDelegationsInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableResourceGroupDelegations. + */ +public class AvailableResourceGroupDelegationsInner { + /** The Retrofit service to perform REST calls. */ + private AvailableResourceGroupDelegationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableResourceGroupDelegationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableResourceGroupDelegationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableResourceGroupDelegationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableResourceGroupDelegations to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableResourceGroupDelegationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableResourceGroupDelegations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations") + Observable> list(@Path("location") String location, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AvailableResourceGroupDelegations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList list(final String location, final String resourceGroupName) { + ServiceResponse> response = listSinglePageAsync(location, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listAsync(final String location, final String resourceGroupName) { + return listWithServiceResponseAsync(location, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location, final String resourceGroupName) { + return listSinglePageAsync(location, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + ServiceResponse> * @param location The location of the domain name. + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location, final String resourceGroupName) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableDelegationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableDelegationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableDelegationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagImpl.java new file mode 100644 index 0000000000000..b5c7451f80141 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTag; +import rx.Observable; + +class AzureFirewallFqdnTagImpl extends GroupableResourceCoreImpl implements AzureFirewallFqdnTag { + AzureFirewallFqdnTagImpl(String name, AzureFirewallFqdnTagInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallFqdnTagsInner client = this.manager().inner().azureFirewallFqdnTags(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String fqdnTagName() { + return this.inner().fqdnTagName(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagInner.java new file mode 100644 index 0000000000000..0e7acfab127b6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagInner.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall FQDN Tag Resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallFqdnTagInner extends Resource { + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of this FQDN Tag. + */ + @JsonProperty(value = "properties.fqdnTagName", access = JsonProperty.Access.WRITE_ONLY) + private String fqdnTagName; + + /** + * Gets 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 provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of this FQDN Tag. + * + * @return the fqdnTagName value + */ + public String fqdnTagName() { + return this.fqdnTagName; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallFqdnTagInner object itself. + */ + public AzureFirewallFqdnTagInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsImpl.java new file mode 100644 index 0000000000000..bb5b7656eb599 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTags; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTag; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallFqdnTagsImpl extends GroupableResourcesCoreImpl implements AzureFirewallFqdnTags { + protected AzureFirewallFqdnTagsImpl(NetworkManager manager) { + super(manager.inner().azureFirewallFqdnTags(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallFqdnTagsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + AzureFirewallFqdnTagsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallFqdnTagsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewallFqdnTag call(AzureFirewallFqdnTagInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected AzureFirewallFqdnTagImpl wrapModel(AzureFirewallFqdnTagInner inner) { + return new AzureFirewallFqdnTagImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallFqdnTagImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsInner.java new file mode 100644 index 0000000000000..23e45455f8730 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallFqdnTagsInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AzureFirewallFqdnTags. + */ +public class AzureFirewallFqdnTagsInner { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallFqdnTagsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallFqdnTagsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallFqdnTagsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallFqdnTagsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewallFqdnTags to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallFqdnTagsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTags list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTags listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallFqdnTagInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallFqdnTagInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallFqdnTagInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallFqdnTagInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallFqdnTagInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..aae72a21b0051 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewall; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallNatRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallThreatIntelMode; + +class AzureFirewallImpl extends GroupableResourceCoreImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + AzureFirewallImpl(String name, AzureFirewallInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationRuleCollections() { + return this.inner().applicationRuleCollections(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public List natRuleCollections() { + return this.inner().natRuleCollections(); + } + + @Override + public List networkRuleCollections() { + return this.inner().networkRuleCollections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.inner().threatIntelMode(); + } + + @Override + public AzureFirewallImpl withApplicationRuleCollections(List applicationRuleCollections) { + this.inner().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public AzureFirewallImpl withNatRuleCollections(List natRuleCollections) { + this.inner().withNatRuleCollections(natRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withNetworkRuleCollections(List networkRuleCollections) { + this.inner().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public AzureFirewallImpl withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.inner().withThreatIntelMode(threatIntelMode); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallInner.java new file mode 100644 index 0000000000000..d0fdb9a81857c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallInner.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallNatRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallThreatIntelMode; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallInner extends Resource { + /** + * Collection of application rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.applicationRuleCollections") + private List applicationRuleCollections; + + /** + * Collection of NAT rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.natRuleCollections") + private List natRuleCollections; + + /** + * Collection of network rule collections used by Azure Firewall. + */ + @JsonProperty(value = "properties.networkRuleCollections") + private List networkRuleCollections; + + /** + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The operation mode for Threat Intelligence. Possible values include: + * 'Alert', 'Deny', 'Off'. + */ + @JsonProperty(value = "properties.threatIntelMode") + private AzureFirewallThreatIntelMode threatIntelMode; + + /** + * Gets 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 collection of application rule collections used by Azure Firewall. + * + * @return the applicationRuleCollections value + */ + public List applicationRuleCollections() { + return this.applicationRuleCollections; + } + + /** + * Set collection of application rule collections used by Azure Firewall. + * + * @param applicationRuleCollections the applicationRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withApplicationRuleCollections(List applicationRuleCollections) { + this.applicationRuleCollections = applicationRuleCollections; + return this; + } + + /** + * Get collection of NAT rule collections used by Azure Firewall. + * + * @return the natRuleCollections value + */ + public List natRuleCollections() { + return this.natRuleCollections; + } + + /** + * Set collection of NAT rule collections used by Azure Firewall. + * + * @param natRuleCollections the natRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNatRuleCollections(List natRuleCollections) { + this.natRuleCollections = natRuleCollections; + return this; + } + + /** + * Get collection of network rule collections used by Azure Firewall. + * + * @return the networkRuleCollections value + */ + public List networkRuleCollections() { + return this.networkRuleCollections; + } + + /** + * Set collection of network rule collections used by Azure Firewall. + * + * @param networkRuleCollections the networkRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNetworkRuleCollections(List networkRuleCollections) { + this.networkRuleCollections = networkRuleCollections; + return this; + } + + /** + * Get iP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configuration of the Azure Firewall resource. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off'. + * + * @return the threatIntelMode value + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.threatIntelMode; + } + + /** + * Set the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off'. + * + * @param threatIntelMode the threatIntelMode value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.threatIntelMode = threatIntelMode; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsImpl.java new file mode 100644 index 0000000000000..8884067c5cfbb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewall; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallsImpl extends GroupableResourcesCoreImpl implements AzureFirewalls { + protected AzureFirewallsImpl(NetworkManager manager) { + super(manager.inner().azureFirewalls(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AzureFirewallImpl define(String name) { + return wrapModel(name); + } + + @Override + protected AzureFirewallImpl wrapModel(AzureFirewallInner inner) { + return new AzureFirewallImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallImpl wrapModel(String name) { + return new AzureFirewallImpl(name, new AzureFirewallInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsInner.java new file mode 100644 index 0000000000000..f37661e238b5c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureFirewallsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AzureFirewalls. + */ +public class AzureFirewallsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewalls to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String azureFirewallName) { + deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().last().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String azureFirewallName) { + return deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String azureFirewallName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String azureFirewallName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * 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 + * @return the observable to the AzureFirewallInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AzureFirewallInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner beginCreateOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the AzureFirewallInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AzureFirewallInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..1d1c0cb86322e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReport; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportItem; + +class AzureReachabilityReportImpl extends WrapperImpl implements AzureReachabilityReport { + private final NetworkManager manager; + AzureReachabilityReportImpl(AzureReachabilityReportInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String aggregationLevel() { + return this.inner().aggregationLevel(); + } + + @Override + public AzureReachabilityReportLocation providerLocation() { + return this.inner().providerLocation(); + } + + @Override + public List reachabilityReport() { + return this.inner().reachabilityReport(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportInner.java new file mode 100644 index 0000000000000..870ae5870b5d7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/AzureReachabilityReportInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details. + */ +public class AzureReachabilityReportInner { + /** + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /** + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get 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 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 parameters that define a geographic location. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set 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 list of Azure reachability report items. + * + * @return the reachabilityReport value + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolImpl.java new file mode 100644 index 0000000000000..60f2d86a43982 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.SubResource; + +class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl implements BackendAddressPool { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String backendAddressPoolName; + + BackendAddressPoolImpl(BackendAddressPoolInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.backendAddressPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "backendAddressPools"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerBackendAddressPoolsInner client = this.manager().inner().loadBalancerBackendAddressPools(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.backendAddressPoolName); + } + + + + @Override + public List backendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().backendIPConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().backendIPConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource outboundRule() { + return this.inner().outboundRule(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolInner.java new file mode 100644 index 0000000000000..b7a712cc6d2f0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BackendAddressPoolInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Pool of backend IP addresses. + */ +@JsonFlatten +public class BackendAddressPoolInner extends SubResource { + /** + * Gets collection of references to IP addresses defined in network + * interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIPConfigurations; + + /** + * Gets load balancing rules that use this backend address pool. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * Gets outbound rules that use this backend address pool. + */ + @JsonProperty(value = "properties.outboundRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundRule; + + /** + * Get provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets 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") + private String etag; + + /** + * Get gets collection of references to IP addresses defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Get gets load balancing rules that use this backend address pool. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get gets outbound rules that use this backend address pool. + * + * @return the outboundRule value + */ + public SubResource outboundRule() { + return this.outboundRule; + } + + /** + * Get get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultImpl.java new file mode 100644 index 0000000000000..8ef985c5cc1b8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.BgpPeerStatusListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BgpPeerStatus; + +class BgpPeerStatusListResultImpl extends WrapperImpl implements BgpPeerStatusListResult { + private final NetworkManager manager; + BgpPeerStatusListResultImpl(BgpPeerStatusListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultInner.java new file mode 100644 index 0000000000000..239793b6e233e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpPeerStatusListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list BGP peer status API service call. + */ +public class BgpPeerStatusListResultInner { + /** + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of BGP peers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesImpl.java new file mode 100644 index 0000000000000..c818ddee85929 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunity; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class BgpServiceCommunitiesImpl extends GroupableResourcesCoreImpl implements BgpServiceCommunities { + protected BgpServiceCommunitiesImpl(NetworkManager manager) { + super(manager.inner().bgpServiceCommunities(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + BgpServiceCommunitiesInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + BgpServiceCommunitiesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + BgpServiceCommunitiesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BgpServiceCommunity call(BgpServiceCommunityInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(BgpServiceCommunityInner inner) { + return new BgpServiceCommunityImpl(inner.name(), inner, manager()); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesInner.java new file mode 100644 index 0000000000000..ad8395b42acc4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunitiesInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BgpServiceCommunities. + */ +public class BgpServiceCommunitiesInner { + /** The Retrofit service to perform REST calls. */ + private BgpServiceCommunitiesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BgpServiceCommunitiesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(BgpServiceCommunitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BgpServiceCommunities to be + * used by Retrofit to perform actually REST calls. + */ + interface BgpServiceCommunitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunities list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunities listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..d568cfd09ddc9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunity; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BGPCommunity; + +class BgpServiceCommunityImpl extends GroupableResourceCoreImpl implements BgpServiceCommunity { + BgpServiceCommunityImpl(String name, BgpServiceCommunityInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bgpCommunities() { + return this.inner().bgpCommunities(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityInner.java new file mode 100644 index 0000000000000..e05a13e697375 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/BgpServiceCommunityInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BGPCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service Community Properties. + */ +@JsonFlatten +@SkipParentValidation +public class BgpServiceCommunityInner extends Resource { + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Get a list of bgp communities. + */ + @JsonProperty(value = "properties.bgpCommunities") + private List bgpCommunities; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param serviceName the serviceName value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get get a list of bgp communities. + * + * @return the bgpCommunities value + */ + public List bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set get a list of bgp communities. + * + * @param bgpCommunities the bgpCommunities value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorInner.java new file mode 100644 index 0000000000000..2aa241a15ab95 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorInner { + /** + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Describes the source of connection monitor. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get connection monitor location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set connection monitor location. + * + * @param location the location value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get connection monitor tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set connection monitor tags. + * + * @param tags the tags value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get describes the source of connection monitor. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set describes the source of connection monitor. + * + * @param source the source value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get describes the destination of connection monitor. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set describes the destination of connection monitor. + * + * @param destination the destination value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultImpl.java new file mode 100644 index 0000000000000..db0eaa8dfdf28 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionStateSnapshot; + +class ConnectionMonitorQueryResultImpl extends WrapperImpl implements ConnectionMonitorQueryResult { + private final NetworkManager manager; + ConnectionMonitorQueryResultImpl(ConnectionMonitorQueryResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorSourceStatus sourceStatus() { + return this.inner().sourceStatus(); + } + + @Override + public List states() { + return this.inner().states(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultInner.java new file mode 100644 index 0000000000000..1559ce8062e35 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of connection states snapshots. + */ +public class ConnectionMonitorQueryResultInner { + /** + * Status of connection monitor source. Possible values include: 'Unknown', + * 'Active', 'Inactive'. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /** + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get status of connection monitor source. Possible values include: 'Unknown', 'Active', 'Inactive'. + * + * @return the sourceStatus value + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set status of connection monitor source. Possible values include: 'Unknown', 'Active', 'Inactive'. + * + * @param sourceStatus the sourceStatus value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get information about connection states. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 0000000000000..3f603bfc11530 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ConnectionMonitorResultImpl extends CreatableUpdatableImpl implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String connectionMonitorName; + private ConnectionMonitorInner createOrUpdateParameter; + + ConnectionMonitorResultImpl(String name, NetworkManager manager) { + super(name, new ConnectionMonitorResultInner()); + this.manager = manager; + // Set resource name + this.connectionMonitorName = name; + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + ConnectionMonitorResultImpl(ConnectionMonitorResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionMonitorName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.connectionMonitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "connectionMonitors"); + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public Boolean autoStart() { + return this.inner().autoStart(); + } + + @Override + public ConnectionMonitorDestination destination() { + return this.inner().destination(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer monitoringIntervalInSeconds() { + return this.inner().monitoringIntervalInSeconds(); + } + + @Override + public String monitoringStatus() { + return this.inner().monitoringStatus(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionMonitorSource source() { + return this.inner().source(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ConnectionMonitorResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createOrUpdateParameter.withDestination(destination); + return this; + } + + @Override + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createOrUpdateParameter.withSource(source); + return this; + } + + @Override + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createOrUpdateParameter.withAutoStart(autoStart); + return this; + } + + @Override + public ConnectionMonitorResultImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createOrUpdateParameter.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + @Override + public ConnectionMonitorResultImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultInner.java new file mode 100644 index 0000000000000..5223259be5229 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorResultInner.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Information about the connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorResultInner extends Resource { + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Describes the source of connection monitor. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * The provisioning state of the connection monitor. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "properties.monitoringStatus") + private String monitoringStatus; + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get describes the source of connection monitor. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set describes the source of connection monitor. + * + * @param source the source value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get describes the destination of connection monitor. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set describes the destination of connection monitor. + * + * @param destination the destination value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date and time when the connection monitor was started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date and time when the connection monitor was started. + * + * @param startTime the startTime value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the monitoring status of the connection monitor. + * + * @return the monitoringStatus value + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoring status of the connection monitor. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringStatus(String monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 0000000000000..08c2787961877 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitorResult; + +class ConnectionMonitorsImpl extends WrapperImpl implements ConnectionMonitors { + private final NetworkManager manager; + + ConnectionMonitorsImpl(NetworkManager manager) { + super(manager.inner().connectionMonitors()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorResultImpl define(String name) { + return wrapModel(name); + } + + private ConnectionMonitorResultImpl wrapModel(ConnectionMonitorResultInner inner) { + return new ConnectionMonitorResultImpl(inner, manager()); + } + + private ConnectionMonitorResultImpl wrapModel(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorQueryResult call(ConnectionMonitorQueryResultInner inner) { + return new ConnectionMonitorQueryResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + ConnectionMonitorsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsInner.java new file mode 100644 index 0000000000000..e2af26f0088e0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionMonitorsInner.java @@ -0,0 +1,1134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2019_02_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in ConnectionMonitors. + */ +public class ConnectionMonitorsInner { + /** The Retrofit service to perform REST calls. */ + private ConnectionMonitorsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConnectionMonitorsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ConnectionMonitorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConnectionMonitors to be + * used by Retrofit to perform actually REST calls. + */ + interface ConnectionMonitorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors query" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> query(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors beginQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> beginQuery(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner beginCreateOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.start(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner query(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> queryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.query(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginQueryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException 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<ConnectionMonitorResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..2811714e91cef --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionResetSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionResetSharedKeyImpl extends WrapperImpl implements ConnectionResetSharedKey { + private final NetworkManager manager; + ConnectionResetSharedKeyImpl(ConnectionResetSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public int keyLength() { + return this.inner().keyLength(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..ebc84607c071d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionResetSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network connection reset shared key. + */ +public class ConnectionResetSharedKeyInner { + /** + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..33bcd96ae77dc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectionSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionSharedKeyImpl extends WrapperImpl implements ConnectionSharedKey { + private final NetworkManager manager; + ConnectionSharedKeyImpl(ConnectionSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyInner.java new file mode 100644 index 0000000000000..06cc29a84ca96 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectionSharedKeyInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Response for GetConnectionSharedKey API service call. + */ +public class ConnectionSharedKeyInner extends SubResource { + /** + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the virtual network connection shared key value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationImpl.java new file mode 100644 index 0000000000000..f6d6d8a3259ea --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityHop; + +class ConnectivityInformationImpl extends WrapperImpl implements ConnectivityInformation { + private final NetworkManager manager; + ConnectivityInformationImpl(ConnectivityInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Integer avgLatencyInMs() { + return this.inner().avgLatencyInMs(); + } + + @Override + public ConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public List hops() { + return this.inner().hops(); + } + + @Override + public Integer maxLatencyInMs() { + return this.inner().maxLatencyInMs(); + } + + @Override + public Integer minLatencyInMs() { + return this.inner().minLatencyInMs(); + } + + @Override + public Integer probesFailed() { + return this.inner().probesFailed(); + } + + @Override + public Integer probesSent() { + return this.inner().probesSent(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationInner.java new file mode 100644 index 0000000000000..cf83043bbb3c0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ConnectivityInformationInner.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityHop; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information on the connectivity status. + */ +public class ConnectivityInformationInner { + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * The connection status. Possible values include: 'Unknown', 'Connected', + * 'Disconnected', 'Degraded'. + */ + @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 list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded'. + * + * @return the connectionStatus value + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get average latency in milliseconds. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get minimum latency in milliseconds. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get maximum latency in milliseconds. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get total number of probes sent. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesImpl.java new file mode 100644 index 0000000000000..ea6c8eaefd2f9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies; +import com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicy; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; + +class DdosCustomPoliciesImpl extends GroupableResourcesCoreImpl implements DdosCustomPolicies { + protected DdosCustomPoliciesImpl(NetworkManager manager) { + super(manager.inner().ddosCustomPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DdosCustomPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DdosCustomPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public DdosCustomPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DdosCustomPolicyImpl wrapModel(DdosCustomPolicyInner inner) { + return new DdosCustomPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected DdosCustomPolicyImpl wrapModel(String name) { + return new DdosCustomPolicyImpl(name, new DdosCustomPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesInner.java new file mode 100644 index 0000000000000..b771c918cf9fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPoliciesInner.java @@ -0,0 +1,810 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DdosCustomPolicies. + */ +public class DdosCustomPoliciesInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private DdosCustomPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosCustomPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DdosCustomPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DdosCustomPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DdosCustomPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface DdosCustomPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Body DdosCustomPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Body DdosCustomPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("ddosCustomPolicyName") String ddosCustomPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ddosCustomPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).toBlocking().last().body(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String ddosCustomPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String ddosCustomPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String ddosCustomPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).toBlocking().single().body(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String ddosCustomPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String ddosCustomPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner createOrUpdate(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner beginCreateOrUpdate(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).toBlocking().last().body(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName), serviceCallback); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String ddosCustomPolicyName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags).toBlocking().last().body(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags), serviceCallback); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner beginUpdateTags(String resourceGroupName, String ddosCustomPolicyName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).toBlocking().single().body(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName), serviceCallback); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String ddosCustomPolicyName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @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 + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosCustomPolicyInner object if successful. + */ + public DdosCustomPolicyInner beginUpdateTags(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags).toBlocking().single().body(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags), serviceCallback); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosCustomPolicyName, tags).map(new Func1, DdosCustomPolicyInner>() { + @Override + public DdosCustomPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosCustomPolicyInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String ddosCustomPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosCustomPolicyName == null) { + throw new IllegalArgumentException("Parameter ddosCustomPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, ddosCustomPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyImpl.java new file mode 100644 index 0000000000000..f946c5a30a55a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyImpl.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicy; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProtocolCustomSettingsFormat; + +class DdosCustomPolicyImpl extends GroupableResourceCoreImpl implements DdosCustomPolicy, DdosCustomPolicy.Definition, DdosCustomPolicy.Update { + DdosCustomPolicyImpl(String name, DdosCustomPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DdosCustomPoliciesInner client = this.manager().inner().ddosCustomPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DdosCustomPoliciesInner client = this.manager().inner().ddosCustomPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DdosCustomPoliciesInner client = this.manager().inner().ddosCustomPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List protocolCustomSettings() { + return this.inner().protocolCustomSettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List publicIPAddresses() { + return this.inner().publicIPAddresses(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public DdosCustomPolicyImpl withProtocolCustomSettings(List protocolCustomSettings) { + this.inner().withProtocolCustomSettings(protocolCustomSettings); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyInner.java new file mode 100644 index 0000000000000..c18ac55b2f34f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosCustomPolicyInner.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProtocolCustomSettingsFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A DDoS custom policy in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class DdosCustomPolicyInner extends Resource { + /** + * The resource GUID property of the DDoS custom policy resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the DDoS custom policy resource. Possible + * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of public IPs associated with the DDoS custom policy resource. + * This list is read-only. + */ + @JsonProperty(value = "properties.publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIPAddresses; + + /** + * The protocol-specific DDoS policy customization parameters. + */ + @JsonProperty(value = "properties.protocolCustomSettings") + private List protocolCustomSettings; + + /** + * 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 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 provisioning state of the DDoS custom policy resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value + */ + public List protocolCustomSettings() { + return this.protocolCustomSettings; + } + + /** + * Set the protocol-specific DDoS policy customization parameters. + * + * @param protocolCustomSettings the protocolCustomSettings value to set + * @return the DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withProtocolCustomSettings(List protocolCustomSettings) { + this.protocolCustomSettings = protocolCustomSettings; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 0000000000000..9044d40bd3a7e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlan; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; + +class DdosProtectionPlanImpl extends GroupableResourceCoreImpl implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + DdosProtectionPlanImpl(String name, DdosProtectionPlanInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List virtualNetworks() { + return this.inner().virtualNetworks(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanInner.java new file mode 100644 index 0000000000000..cfd44ff8319d9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlanInner.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A DDoS protection plan in a resource group. + */ +@JsonFlatten +public class DdosProtectionPlanInner extends Resource { + /** + * The resource GUID property of the DDoS protection plan resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the DDoS protection plan resource. Possible + * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + */ + @JsonProperty(value = "properties.virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworks; + + /** + * 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 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 provisioning state of the DDoS protection plan resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansImpl.java new file mode 100644 index 0000000000000..eab0ce21a9ab0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlan; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DdosProtectionPlansImpl extends GroupableResourcesCoreImpl implements DdosProtectionPlans { + protected DdosProtectionPlansImpl(NetworkManager manager) { + super(manager.inner().ddosProtectionPlans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DdosProtectionPlansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DdosProtectionPlanImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(DdosProtectionPlanInner inner) { + return new DdosProtectionPlanImpl(inner.name(), inner, manager()); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(String name) { + return new DdosProtectionPlanImpl(name, new DdosProtectionPlanInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansInner.java new file mode 100644 index 0000000000000..d34dc1e5ee321 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DdosProtectionPlansInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DdosProtectionPlans. + */ +public class DdosProtectionPlansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DdosProtectionPlansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DdosProtectionPlansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DdosProtectionPlansService.class); + this.client = client; + } + + /** + * The interface defining all the services for DdosProtectionPlans to be + * used by Retrofit to perform actually REST calls. + */ + interface DdosProtectionPlansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ddosProtectionPlanName) { + deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().last().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner createOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginCreateOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().last().body(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String ddosProtectionPlanName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).toBlocking().last().body(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags), serviceCallback); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginUpdateTags(String resourceGroupName, String ddosProtectionPlanName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String ddosProtectionPlanName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @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 + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginUpdateTags(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).toBlocking().single().body(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags), serviceCallback); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesImpl.java new file mode 100644 index 0000000000000..9f34829c0d57f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.DefaultSecurityRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroupSecurityRuleModel; + +class DefaultSecurityRulesImpl extends WrapperImpl implements DefaultSecurityRules { + private final NetworkManager manager; + + DefaultSecurityRulesImpl(NetworkManager manager) { + super(manager.inner().defaultSecurityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkSecurityGroupSecurityRuleModelImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + DefaultSecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + DefaultSecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesInner.java new file mode 100644 index 0000000000000..208de7885cb9c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DefaultSecurityRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DefaultSecurityRules. + */ +public class DefaultSecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private DefaultSecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DefaultSecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DefaultSecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DefaultSecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface DefaultSecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DefaultSecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DefaultSecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("defaultSecurityRuleName") String defaultSecurityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.DefaultSecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (defaultSecurityRuleName == null) { + throw new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DnsNameAvailabilityResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DnsNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..685275b40a600 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/DnsNameAvailabilityResultInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for the CheckDnsNameAvailability API service call. + */ +public class DnsNameAvailabilityResultInner { + /** + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get domain availability (True/False). + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..c55eead36fee7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveNetworkSecurityGroup; + +class EffectiveNetworkSecurityGroupListResultImpl extends WrapperImpl implements EffectiveNetworkSecurityGroupListResult { + private final NetworkManager manager; + EffectiveNetworkSecurityGroupListResultImpl(EffectiveNetworkSecurityGroupListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java new file mode 100644 index 0000000000000..5ef2a0dbb8327 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective network security groups API service call. + */ +public class EffectiveNetworkSecurityGroupListResultInner { + /** + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective network security groups. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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 URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..7db8094844128 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.EffectiveRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveRoute; + +class EffectiveRouteListResultImpl extends WrapperImpl implements EffectiveRouteListResult { + private final NetworkManager manager; + EffectiveRouteListResultImpl(EffectiveRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultInner.java new file mode 100644 index 0000000000000..97565dc2e4000 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EffectiveRouteListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective route API service call. + */ +public class EffectiveRouteListResultInner { + /** + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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 URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..2e733a07f027d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.EndpointServiceResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EndpointServiceResultImpl extends WrapperImpl implements EndpointServiceResult { + private final NetworkManager manager; + + EndpointServiceResultImpl(EndpointServiceResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultInner.java new file mode 100644 index 0000000000000..f24e185d99c9f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/EndpointServiceResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Endpoint service. + */ +public class EndpointServiceResultInner extends SubResource { + /** + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the endpoint service. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the endpoint service. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..72fc04817bf63 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.AuthorizationUseStatus; + +class ExpressRouteCircuitAuthorizationImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitAuthorization, ExpressRouteCircuitAuthorization.Definition, ExpressRouteCircuitAuthorization.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String authorizationName; + + ExpressRouteCircuitAuthorizationImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitAuthorizationInner()); + this.manager = manager; + // Set resource name + this.authorizationName = name; + // + } + + ExpressRouteCircuitAuthorizationImpl(ExpressRouteCircuitAuthorizationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.authorizationName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.authorizationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public AuthorizationUseStatus authorizationUseStatus() { + return this.inner().authorizationUseStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.inner().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 0000000000000..55c26396b2701 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AuthorizationUseStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authorization in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitAuthorizationInner extends SubResource { + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse'. + */ + @JsonProperty(value = "properties.authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets 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 authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @return the authorizationUseStatus value + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Set authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @param authorizationUseStatus the authorizationUseStatus value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java new file mode 100644 index 0000000000000..8f0d09d456e1e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorization; + +class ExpressRouteCircuitAuthorizationsImpl extends WrapperImpl implements ExpressRouteCircuitAuthorizations { + private final NetworkManager manager; + + ExpressRouteCircuitAuthorizationsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitAuthorizations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(ExpressRouteCircuitAuthorizationInner inner) { + return new ExpressRouteCircuitAuthorizationImpl(inner, manager()); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, authorizationName) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, authorizationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsInner.java new file mode 100644 index 0000000000000..a52f1764c3d11 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitAuthorizationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitAuthorizations. + */ +public class ExpressRouteCircuitAuthorizationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitAuthorizationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitAuthorizationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitAuthorizationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitAuthorizations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitAuthorizationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String authorizationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..e06914a20d706 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.CircuitConnectionStatus; + +class ExpressRouteCircuitConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitConnection, ExpressRouteCircuitConnection.Definition, ExpressRouteCircuitConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + private String connectionName; + + ExpressRouteCircuitConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteCircuitConnectionImpl(ExpressRouteCircuitConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "connections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public CircuitConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peerExpressRouteCircuitPeering() { + return this.inner().peerExpressRouteCircuitPeering(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitConnectionImpl withExistingPeering(String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withCircuitConnectionStatus(CircuitConnectionStatus circuitConnectionStatus) { + this.inner().withCircuitConnectionStatus(circuitConnectionStatus); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.inner().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..7ba2f52201cb0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionInner.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.CircuitConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@JsonFlatten +public class ExpressRouteCircuitConnectionInner extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /** + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * Express Route Circuit connection state. Possible values include: + * 'Connected', 'Connecting', 'Disconnected'. + */ + @JsonProperty(value = "properties.circuitConnectionStatus") + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Provisioning state of the circuit connection resource. Possible values + * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets 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 reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @return the expressRouteCircuitPeering value + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Set express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @param circuitConnectionStatus the circuitConnectionStatus value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withCircuitConnectionStatus(CircuitConnectionStatus circuitConnectionStatus) { + this.circuitConnectionStatus = circuitConnectionStatus; + return this; + } + + /** + * Get provisioning state of the circuit connection resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets 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 gets 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..5806f09052c86 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnection; + +class ExpressRouteCircuitConnectionsImpl extends WrapperImpl implements ExpressRouteCircuitConnections { + private final NetworkManager manager; + + ExpressRouteCircuitConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(ExpressRouteCircuitConnectionInner inner) { + return new ExpressRouteCircuitConnectionImpl(inner, manager()); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName, peeringName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitConnection call(ExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteCircuitConnection call(ExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsInner.java new file mode 100644 index 0000000000000..9a3300aa8959b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitConnectionsInner.java @@ -0,0 +1,807 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitConnections. + */ +public class ExpressRouteCircuitConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner get(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName, final String peeringName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName, peeringName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final String peeringName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName, peeringName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + return listSinglePageAsync(resourceGroupName, circuitName, peeringName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + ServiceResponse> * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..3082e8cf37372 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuit; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2019_02_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitServiceProviderProperties; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitImpl extends GroupableResourceCoreImpl implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { + ExpressRouteCircuitImpl(String name, ExpressRouteCircuitInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowClassicOperations() { + return this.inner().allowClassicOperations(); + } + + @Override + public List authorizations() { + List lst = new ArrayList(); + if (this.inner().authorizations() != null) { + for (ExpressRouteCircuitAuthorizationInner inner : this.inner().authorizations()) { + lst.add( new ExpressRouteCircuitAuthorizationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Double bandwidthInGbps() { + return this.inner().bandwidthInGbps(); + } + + @Override + public String circuitProvisioningState() { + return this.inner().circuitProvisioningState(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRoutePort() { + return this.inner().expressRoutePort(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public Boolean globalReachEnabled() { + return this.inner().globalReachEnabled(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String serviceKey() { + return this.inner().serviceKey(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.inner().serviceProviderProperties(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public ExpressRouteCircuitSku sku() { + return this.inner().sku(); + } + + @Override + public Integer stag() { + return this.inner().stag(); + } + + @Override + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.inner().withAllowClassicOperations(allowClassicOperations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.inner().withAuthorizations(authorizations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withBandwidthInGbps(Double bandwidthInGbps) { + this.inner().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + @Override + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.inner().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withExpressRoutePort(SubResource expressRoutePort) { + this.inner().withExpressRoutePort(expressRoutePort); + return this; + } + + @Override + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitImpl withGlobalReachEnabled(Boolean globalReachEnabled) { + this.inner().withGlobalReachEnabled(globalReachEnabled); + return this; + } + + @Override + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCircuitImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.inner().withServiceKey(serviceKey); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.inner().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitInner.java new file mode 100644 index 0000000000000..014795d682ab3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitInner.java @@ -0,0 +1,453 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2019_02_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitServiceProviderProperties; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCircuit resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCircuitInner extends Resource { + /** + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /** + * Allow classic operations. + */ + @JsonProperty(value = "properties.allowClassicOperations") + private Boolean allowClassicOperations; + + /** + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.circuitProvisioningState") + private String circuitProvisioningState; + + /** + * The ServiceProviderProvisioningState state of the resource. Possible + * values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + * 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * The list of authorizations. + */ + @JsonProperty(value = "properties.authorizations") + private List authorizations; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The ServiceKey. + */ + @JsonProperty(value = "properties.serviceKey") + private String serviceKey; + + /** + * The ServiceProviderNotes. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * The ServiceProviderProperties. + */ + @JsonProperty(value = "properties.serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /** + * The reference to the ExpressRoutePort resource when the circuit is + * provisioned on an ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.expressRoutePort") + private SubResource expressRoutePort; + + /** + * The bandwidth of the circuit when the circuit is provisioned on an + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Double bandwidthInGbps; + + /** + * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + */ + @JsonProperty(value = "properties.stag", access = JsonProperty.Access.WRITE_ONLY) + private Integer stag; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Flag denoting Global reach status. + */ + @JsonProperty(value = "properties.globalReachEnabled") + private Boolean globalReachEnabled; + + /** + * Gets 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. + * + * @return the sku value + */ + public ExpressRouteCircuitSku sku() { + return this.sku; + } + + /** + * Set 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 allow classic operations. + * + * @return the allowClassicOperations value + */ + public Boolean allowClassicOperations() { + return this.allowClassicOperations; + } + + /** + * Set allow classic operations. + * + * @param allowClassicOperations the allowClassicOperations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { + this.allowClassicOperations = allowClassicOperations; + return this; + } + + /** + * Get the CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value + */ + public String circuitProvisioningState() { + return this.circuitProvisioningState; + } + + /** + * Set the CircuitProvisioningState state of the resource. + * + * @param circuitProvisioningState the circuitProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { + this.circuitProvisioningState = circuitProvisioningState; + return this; + } + + /** + * Get the ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the list of authorizations. + * + * @return the authorizations value + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the list of authorizations. + * + * @param authorizations the authorizations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the ServiceKey. + * + * @return the serviceKey value + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Set the ServiceKey. + * + * @param serviceKey the serviceKey value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + this.serviceKey = serviceKey; + return this; + } + + /** + * Get the ServiceProviderNotes. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the ServiceProviderProperties. + * + * @return the serviceProviderProperties value + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.serviceProviderProperties; + } + + /** + * Set the ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.serviceProviderProperties = serviceProviderProperties; + return this; + } + + /** + * Get the 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 reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + * + * @param expressRoutePort the expressRoutePort value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withExpressRoutePort(SubResource expressRoutePort) { + this.expressRoutePort = expressRoutePort; + return this; + } + + /** + * Get the bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + * + * @return the bandwidthInGbps value + */ + public Double bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set 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(Double bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get the identifier of the circuit traffic. Outer tag for QinQ encapsulation. + * + * @return the stag value + */ + public Integer stag() { + return this.stag; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get flag denoting Global reach status. + * + * @return the globalReachEnabled value + */ + public Boolean globalReachEnabled() { + return this.globalReachEnabled; + } + + /** + * Set flag denoting Global reach status. + * + * @param globalReachEnabled the globalReachEnabled value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGlobalReachEnabled(Boolean globalReachEnabled) { + this.globalReachEnabled = globalReachEnabled; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringImpl.java new file mode 100644 index 0000000000000..ec0024d54f955 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,353 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnectionId; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnection; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilter; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + + ExpressRouteCircuitPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCircuitPeeringImpl(ExpressRouteCircuitPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (ExpressRouteCircuitConnectionInner inner : this.inner().connections()) { + lst.add( new ExpressRouteCircuitConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteConnectionId expressRouteConnection() { + return this.inner().expressRouteConnection(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public List peeredConnections() { + List lst = new ArrayList(); + if (this.inner().peeredConnections() != null) { + for (PeerExpressRouteCircuitConnectionInner inner : this.inner().peeredConnections()) { + lst.add( new PeerExpressRouteCircuitConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteFilter routeFilter() { + RouteFilterInner inner = this.inner().routeFilter(); + if (inner != null) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.inner().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withAzureASN(Integer azureASN) { + this.inner().withAzureASN(azureASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.inner().withExpressRouteConnection(expressRouteConnection); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.inner().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withRouteFilter(RouteFilterInner routeFilter) { + this.inner().withRouteFilter(routeFilter); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.inner().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.inner().withStats(stats); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringInner.java new file mode 100644 index 0000000000000..050c77b0d3e4a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,581 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnectionId; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN") + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort") + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort") + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets peering stats. + */ + @JsonProperty(value = "properties.stats") + private ExpressRouteCircuitStatsInner stats; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "properties.routeFilter") + private RouteFilterInner routeFilter; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * The ExpressRoute connection. + */ + @JsonProperty(value = "properties.expressRouteConnection") + private ExpressRouteConnectionId expressRouteConnection; + + /** + * The list of circuit connections associated with Azure Private Peering + * for this circuit. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * The list of peered circuit connections associated with Azure Private + * Peering for this circuit. + */ + @JsonProperty(value = "properties.peeredConnections", access = JsonProperty.Access.WRITE_ONLY) + private List peeredConnections; + + /** + * Gets 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 peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Set the Azure ASN. + * + * @param azureASN the azureASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withAzureASN(Integer azureASN) { + this.azureASN = azureASN; + return this; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Set the primary port. + * + * @param primaryAzurePort the primaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { + this.primaryAzurePort = primaryAzurePort; + return this; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Set the secondary port. + * + * @param secondaryAzurePort the secondaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { + this.secondaryAzurePort = secondaryAzurePort; + return this; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets peering stats. + * + * @return the stats value + */ + public ExpressRouteCircuitStatsInner stats() { + return this.stats; + } + + /** + * Set gets peering stats. + * + * @param stats the stats value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { + this.stats = stats; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get the ExpressRoute connection. + * + * @return the expressRouteConnection value + */ + public ExpressRouteConnectionId expressRouteConnection() { + return this.expressRouteConnection; + } + + /** + * Set the ExpressRoute connection. + * + * @param expressRouteConnection the expressRouteConnection value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.expressRouteConnection = expressRouteConnection; + return this; + } + + /** + * Get the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @param connections the connections value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get the list of peered circuit connections associated with Azure Private Peering for this circuit. + * + * @return the peeredConnections value + */ + public List peeredConnections() { + return this.peeredConnections; + } + + /** + * Get gets 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 gets 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsImpl.java new file mode 100644 index 0000000000000..6cf69fb163158 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitPeeringsImpl extends WrapperImpl implements ExpressRouteCircuitPeerings { + private final NetworkManager manager; + + ExpressRouteCircuitPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(ExpressRouteCircuitPeeringInner inner) { + return new ExpressRouteCircuitPeeringImpl(inner, manager()); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsInner.java new file mode 100644 index 0000000000000..5cfbabac49885 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitPeerings. + */ +public class ExpressRouteCircuitPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..36acf27a0b82a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitStats; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ExpressRouteCircuitStatsImpl extends WrapperImpl implements ExpressRouteCircuitStats { + private final NetworkManager manager; + ExpressRouteCircuitStatsImpl(ExpressRouteCircuitStatsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Long primarybytesIn() { + return this.inner().primarybytesIn(); + } + + @Override + public Long primarybytesOut() { + return this.inner().primarybytesOut(); + } + + @Override + public Long secondarybytesIn() { + return this.inner().secondarybytesIn(); + } + + @Override + public Long secondarybytesOut() { + return this.inner().secondarybytesOut(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsInner.java new file mode 100644 index 0000000000000..acee2568768a6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains stats associated with the peering. + */ +public class ExpressRouteCircuitStatsInner { + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get gets BytesIn of the peering. + * + * @return the primarybytesIn value + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set gets 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 gets BytesOut of the peering. + * + * @return the primarybytesOut value + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set gets 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 gets BytesIn of the peering. + * + * @return the secondarybytesIn value + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set gets 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 gets BytesOut of the peering. + * + * @return the secondarybytesOut value + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set gets 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..43eb9fc9ea868 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitArpTable; + +class ExpressRouteCircuitsArpTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsArpTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsArpTableListResultImpl(ExpressRouteCircuitsArpTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 0000000000000..0fb2e495d08a6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsArpTableListResultInner { + /** + * Gets list of the ARP table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get gets list of the ARP table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set gets list of the ARP table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsImpl.java new file mode 100644 index 0000000000000..a7e2fcb9e3d4e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuit; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCircuits { + protected ExpressRouteCircuitsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuits(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCircuitsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCircuitImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(ExpressRouteCircuitInner inner) { + return new ExpressRouteCircuitImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(String name) { + return new ExpressRouteCircuitImpl(name, new ExpressRouteCircuitInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResult call(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getStatsAsync(resourceGroupName, circuitName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getPeeringStatsAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsInner.java new file mode 100644 index 0000000000000..da6e6cb8dca57 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsInner.java @@ -0,0 +1,2025 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuits. + */ +public class ExpressRouteCircuitsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuits to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits getStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats") + Observable> getStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits getPeeringStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + Observable> getPeeringStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getStats(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getPeeringStats(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPeeringStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPeeringStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..9cb3be4e775f2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitRoutesTable; + +class ExpressRouteCircuitsRoutesTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableListResultImpl(ExpressRouteCircuitsRoutesTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 0000000000000..b59b3a1ba57bc --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableListResultInner { + /** + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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 URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..a739b22f3cc24 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitRoutesTableSummary; + +class ExpressRouteCircuitsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableSummaryListResultImpl(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..177bafae351a6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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 URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionImpl.java new file mode 100644 index 0000000000000..5f7a4b9bda495 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionImpl.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringId; + +class ExpressRouteConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteConnection, ExpressRouteConnection.Definition, ExpressRouteConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String expressRouteGatewayName; + private String connectionName; + + ExpressRouteConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteConnectionImpl(ExpressRouteConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.expressRouteGatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteConnectionsInner client = this.manager().inner().expressRouteConnections(); + return client.getAsync(this.resourceGroupName, this.expressRouteGatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public ExpressRouteConnectionImpl withExistingExpressRouteGateway(String resourceGroupName, String expressRouteGatewayName) { + this.resourceGroupName = resourceGroupName; + this.expressRouteGatewayName = expressRouteGatewayName; + return this; + } + + @Override + public ExpressRouteConnectionImpl withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteConnectionImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionInner.java new file mode 100644 index 0000000000000..86c7efe071920 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringId; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ExpressRouteConnection resource. + */ +@JsonFlatten +public class ExpressRouteConnectionInner extends SubResource { + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The ExpressRoute circuit peering. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering", required = true) + private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; + + /** + * Authorization key to establish the connection. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The routing weight associated to the connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value + */ + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set the ExpressRoute circuit peering. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withExpressRouteCircuitPeering(ExpressRouteCircuitPeeringId expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get authorization key to establish the connection. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set authorization key to establish the connection. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the routing weight associated to the connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight associated to the connection. + * + * @param routingWeight the routingWeight value to set + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListImpl.java new file mode 100644 index 0000000000000..bb5b117adf7f2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnectionList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ExpressRouteConnectionListImpl extends WrapperImpl implements ExpressRouteConnectionList { + private final NetworkManager manager; + ExpressRouteConnectionListImpl(ExpressRouteConnectionListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListInner.java new file mode 100644 index 0000000000000..3942169a4404c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ExpressRouteConnection list. + */ +public class ExpressRouteConnectionListInner { + /** + * The list of ExpressRoute connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of ExpressRoute connections. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsImpl.java new file mode 100644 index 0000000000000..16766e8aa962b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnectionList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnection; + +class ExpressRouteConnectionsImpl extends WrapperImpl implements ExpressRouteConnections { + private final NetworkManager manager; + + ExpressRouteConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteConnectionImpl wrapModel(ExpressRouteConnectionInner inner) { + return new ExpressRouteConnectionImpl(inner, manager()); + } + + private ExpressRouteConnectionImpl wrapModel(String name) { + return new ExpressRouteConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, expressRouteGatewayName) + .map(new Func1() { + @Override + public ExpressRouteConnectionList call(ExpressRouteConnectionListInner inner) { + return new ExpressRouteConnectionListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, expressRouteGatewayName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteConnection call(ExpressRouteConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsInner.java new file mode 100644 index 0000000000000..c3795780ab20b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteConnectionsInner.java @@ -0,0 +1,606 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteConnections. + */ +public class ExpressRouteConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteConnectionInner putExpressRouteConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteConnectionInner putExpressRouteConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteConnectionParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteConnectionParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteConnectionParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), putExpressRouteConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteConnectionParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteConnectionParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteConnectionParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), putExpressRouteConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionInner object if successful. + */ + public ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, ExpressRouteConnectionInner>() { + @Override + public ExpressRouteConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, expressRouteGatewayName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteConnectionListInner object if successful. + */ + public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { + return listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionListInner object + */ + public Observable listAsync(String resourceGroupName, String expressRouteGatewayName) { + return listWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, ExpressRouteConnectionListInner>() { + @Override + public ExpressRouteConnectionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteConnectionListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 0000000000000..e99824b8c3374 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2019_02_01.ServiceProviderProvisioningState; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionImpl extends GroupableResourceCoreImpl implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + ExpressRouteCrossConnectionImpl(String name, ExpressRouteCrossConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer bandwidthInMbps() { + return this.inner().bandwidthInMbps(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.inner().expressRouteCircuit(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCrossConnectionPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCrossConnectionPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public Integer sTag() { + return this.inner().sTag(); + } + + @Override + public ExpressRouteCrossConnectionImpl withBandwidthInMbps(Integer bandwidthInMbps) { + this.inner().withBandwidthInMbps(bandwidthInMbps); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.inner().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionInner.java new file mode 100644 index 0000000000000..22a0d6d5573ba --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2019_02_01.ServiceProviderProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCrossConnection resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCrossConnectionInner extends Resource { + /** + * The name of the primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The name of the secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "properties.sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer sTag; + + /** + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "properties.bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "properties.expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /** + * The provisioning state of the circuit in the connectivity provider + * system. Possible values include: 'NotProvisioned', 'Provisioning', + * 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * Gets 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 name of the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the name of the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the identifier of the circuit traffic. + * + * @return the sTag value + */ + public Integer sTag() { + return this.sTag; + } + + /** + * Get the peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location of the ExpressRoute circuit. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the circuit bandwidth In Mbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Get the ExpressRouteCircuit. + * + * @return the expressRouteCircuit value + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.expressRouteCircuit; + } + + /** + * Set the ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.expressRouteCircuit = expressRouteCircuit; + return this; + } + + /** + * Get the provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set additional read only notes set by the connectivity provider. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 0000000000000..11c14f61a210a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.Ipv6ExpressRouteCircuitPeeringConfig; + +class ExpressRouteCrossConnectionPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCrossConnectionPeering, ExpressRouteCrossConnectionPeering.Definition, ExpressRouteCrossConnectionPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String crossConnectionName; + private String peeringName; + + ExpressRouteCrossConnectionPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCrossConnectionPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCrossConnectionPeeringImpl(ExpressRouteCrossConnectionPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.crossConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCrossConnections"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.getAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName) { + this.resourceGroupName = resourceGroupName; + this.crossConnectionName = crossConnectionName; + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringInner.java new file mode 100644 index 0000000000000..1ad3c8359b2c4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringInner.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2019_02_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRoute Cross Connection resource. + */ +@JsonFlatten +public class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Gets 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 peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get gets 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 gets 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java new file mode 100644 index 0000000000000..e206d4da0cfec --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionPeeringsImpl extends WrapperImpl implements ExpressRouteCrossConnectionPeerings { + private final NetworkManager manager; + + ExpressRouteCrossConnectionPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnectionPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(ExpressRouteCrossConnectionPeeringInner inner) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, manager()); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String crossConnectionName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, crossConnectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, crossConnectionName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, crossConnectionName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java new file mode 100644 index 0000000000000..c218a70cf84e7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnectionPeerings. + */ +public class ExpressRouteCrossConnectionPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnectionPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String crossConnectionName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, crossConnectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String crossConnectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, crossConnectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String crossConnectionName) { + return listWithServiceResponseAsync(resourceGroupName, crossConnectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String crossConnectionName) { + return listSinglePageAsync(resourceGroupName, crossConnectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner get(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner createOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsImpl.java new file mode 100644 index 0000000000000..31230c6b2ddbb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnection; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitsRoutesTableListResult; + +class ExpressRouteCrossConnectionsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCrossConnections { + protected ExpressRouteCrossConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCrossConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(ExpressRouteCrossConnectionInner inner) { + return new ExpressRouteCrossConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionImpl(name, new ExpressRouteCrossConnectionInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult call(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsInner.java new file mode 100644 index 0000000000000..d77612ee0dbc9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsInner.java @@ -0,0 +1,1680 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnections. + */ +public class ExpressRouteCrossConnectionsInner implements InnerSupportsGet, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..2cafece56c9ca --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionRoutesTableSummary; + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..f8ca4dc77a548 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + */ +public class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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 URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayImpl.java new file mode 100644 index 0000000000000..51ae4fea1afe4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubId; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnection; + +class ExpressRouteGatewayImpl extends GroupableResourceCoreImpl implements ExpressRouteGateway, ExpressRouteGateway.Definition, ExpressRouteGateway.Update { + ExpressRouteGatewayImpl(String name, ExpressRouteGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteGatewaysInner client = this.manager().inner().expressRouteGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.inner().autoScaleConfiguration(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List expressRouteConnections() { + List lst = new ArrayList(); + if (this.inner().expressRouteConnections() != null) { + for (ExpressRouteConnectionInner inner : this.inner().expressRouteConnections()) { + lst.add( new ExpressRouteConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public VirtualHubId virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public ExpressRouteGatewayImpl withVirtualHub(VirtualHubId virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public ExpressRouteGatewayImpl withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.inner().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + @Override + public ExpressRouteGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayInner.java new file mode 100644 index 0000000000000..0efd7e980ee5b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewayInner.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoute gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteGatewayInner extends Resource { + /** + * Configuration for auto scaling. + */ + @JsonProperty(value = "properties.autoScaleConfiguration") + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /** + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + @JsonProperty(value = "properties.expressRouteConnections", access = JsonProperty.Access.WRITE_ONLY) + private List expressRouteConnections; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The Virtual Hub where the ExpressRoute gateway is or will be deployed. + */ + @JsonProperty(value = "properties.virtualHub", required = true) + private VirtualHubId virtualHub; + + /** + * 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 configuration for auto scaling. + * + * @return the autoScaleConfiguration value + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.autoScaleConfiguration; + } + + /** + * Set configuration for auto scaling. + * + * @param autoScaleConfiguration the autoScaleConfiguration value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withAutoScaleConfiguration(ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.autoScaleConfiguration = autoScaleConfiguration; + return this; + } + + /** + * Get list of ExpressRoute connections to the ExpressRoute gateway. + * + * @return the expressRouteConnections value + */ + public List expressRouteConnections() { + return this.expressRouteConnections; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @return the virtualHub value + */ + public VirtualHubId virtualHub() { + return this.virtualHub; + } + + /** + * Set the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * + * @param virtualHub the virtualHub value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withVirtualHub(VirtualHubId virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysImpl.java new file mode 100644 index 0000000000000..c63ad26c73f11 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteGatewaysImpl extends GroupableResourcesCoreImpl implements ExpressRouteGateways { + protected ExpressRouteGatewaysImpl(NetworkManager manager) { + super(manager.inner().expressRouteGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public ExpressRouteGateway call(ExpressRouteGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteGatewaysInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public ExpressRouteGateway call(ExpressRouteGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteGatewayImpl wrapModel(ExpressRouteGatewayInner inner) { + return new ExpressRouteGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteGatewayImpl wrapModel(String name) { + return new ExpressRouteGatewayImpl(name, new ExpressRouteGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysInner.java new file mode 100644 index 0000000000000..054374614ecac --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteGatewaysInner.java @@ -0,0 +1,662 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteGateways. + */ +public class ExpressRouteGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteGatewayInner putExpressRouteGatewayParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteGatewayInner putExpressRouteGatewayParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("expressRouteGatewayName") String expressRouteGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ExpressRouteGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner createOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteGatewayParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteGatewayParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteGatewayParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), putExpressRouteGatewayParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (putExpressRouteGatewayParameters == null) { + throw new IllegalArgumentException("Parameter putExpressRouteGatewayParameters is required and cannot be null."); + } + Validator.validate(putExpressRouteGatewayParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), putExpressRouteGatewayParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteGatewayInner object if successful. + */ + public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, ExpressRouteGatewayInner>() { + @Override + public ExpressRouteGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRouteGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRouteGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRouteGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRouteGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRouteGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRouteGatewayName == null) { + throw new IllegalArgumentException("Parameter expressRouteGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, expressRouteGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkImpl.java new file mode 100644 index 0000000000000..2bce256cef3e3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLink; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinkAdminState; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinkConnectorType; + +class ExpressRouteLinkImpl extends IndexableRefreshableWrapperImpl implements ExpressRouteLink { + private final NetworkManager manager; + private String resourceGroupName; + private String expressRoutePortName; + private String linkName; + + ExpressRouteLinkImpl(ExpressRouteLinkInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.expressRoutePortName = IdParsingUtils.getValueFromIdByName(inner.id(), "ExpressRoutePorts"); + this.linkName = IdParsingUtils.getValueFromIdByName(inner.id(), "links"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteLinksInner client = this.manager().inner().expressRouteLinks(); + return client.getAsync(this.resourceGroupName, this.expressRoutePortName, this.linkName); + } + + + + @Override + public ExpressRouteLinkAdminState adminState() { + return this.inner().adminState(); + } + + @Override + public ExpressRouteLinkConnectorType connectorType() { + return this.inner().connectorType(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String interfaceName() { + return this.inner().interfaceName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String patchPanelId() { + return this.inner().patchPanelId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String rackId() { + return this.inner().rackId(); + } + + @Override + public String routerName() { + return this.inner().routerName(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkInner.java new file mode 100644 index 0000000000000..c596375b75e29 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinkInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinkConnectorType; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinkAdminState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ExpressRouteLink. + * ExpressRouteLink child resource definition. + */ +@JsonFlatten +public class ExpressRouteLinkInner extends SubResource { + /** + * Name of Azure router associated with physical port. + */ + @JsonProperty(value = "properties.routerName", access = JsonProperty.Access.WRITE_ONLY) + private String routerName; + + /** + * Name of Azure router interface. + */ + @JsonProperty(value = "properties.interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /** + * Mapping between physical port to patch panel port. + */ + @JsonProperty(value = "properties.patchPanelId", access = JsonProperty.Access.WRITE_ONLY) + private String patchPanelId; + + /** + * Mapping of physical patch panel to rack. + */ + @JsonProperty(value = "properties.rackId", access = JsonProperty.Access.WRITE_ONLY) + private String rackId; + + /** + * Physical fiber port type. Possible values include: 'LC', 'SC'. + */ + @JsonProperty(value = "properties.connectorType", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteLinkConnectorType connectorType; + + /** + * Administrative state of the physical port. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.adminState") + private ExpressRouteLinkAdminState adminState; + + /** + * The provisioning state of the ExpressRouteLink resource. Possible values + * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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 name of Azure router associated with physical port. + * + * @return the routerName value + */ + public String routerName() { + return this.routerName; + } + + /** + * Get name of Azure router interface. + * + * @return the interfaceName value + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get mapping between physical port to patch panel port. + * + * @return the patchPanelId value + */ + public String patchPanelId() { + return this.patchPanelId; + } + + /** + * Get mapping of physical patch panel to rack. + * + * @return the rackId value + */ + public String rackId() { + return this.rackId; + } + + /** + * Get physical fiber port type. Possible values include: 'LC', 'SC'. + * + * @return the connectorType value + */ + public ExpressRouteLinkConnectorType connectorType() { + return this.connectorType; + } + + /** + * Get administrative state of the physical port. Possible values include: 'Enabled', 'Disabled'. + * + * @return the adminState value + */ + public ExpressRouteLinkAdminState adminState() { + return this.adminState; + } + + /** + * Set administrative state of the physical port. Possible values include: 'Enabled', 'Disabled'. + * + * @param adminState the adminState value to set + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withAdminState(ExpressRouteLinkAdminState adminState) { + this.adminState = adminState; + return this; + } + + /** + * Get the provisioning state of the ExpressRouteLink resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksImpl.java new file mode 100644 index 0000000000000..8eab85a82ac70 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinks; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLink; + +class ExpressRouteLinksImpl extends WrapperImpl implements ExpressRouteLinks { + private final NetworkManager manager; + + ExpressRouteLinksImpl(NetworkManager manager) { + super(manager.inner().expressRouteLinks()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ExpressRouteLinkImpl wrapModel(ExpressRouteLinkInner inner) { + return new ExpressRouteLinkImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String expressRoutePortName) { + ExpressRouteLinksInner client = this.inner(); + return client.listAsync(resourceGroupName, expressRoutePortName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteLink call(ExpressRouteLinkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + ExpressRouteLinksInner client = this.inner(); + return client.getAsync(resourceGroupName, expressRoutePortName, linkName) + .map(new Func1() { + @Override + public ExpressRouteLink call(ExpressRouteLinkInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksInner.java new file mode 100644 index 0000000000000..9996117620e82 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteLinksInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteLinks. + */ +public class ExpressRouteLinksInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteLinksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteLinksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteLinksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteLinksService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteLinks to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteLinksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Path("linkName") String linkName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteLinkInner object if successful. + */ + public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String expressRoutePortName, String linkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRouteLinkInner object + */ + public Observable getAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName).map(new Func1, ExpressRouteLinkInner>() { + @Override + public ExpressRouteLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRouteLinkInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, String linkName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (linkName == null) { + throw new IllegalArgumentException("Parameter linkName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, linkName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteLinkInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String expressRoutePortName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, expressRoutePortName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String expressRoutePortName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, expressRoutePortName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String expressRoutePortName) { + return listWithServiceResponseAsync(resourceGroupName, expressRoutePortName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String expressRoutePortName) { + return listSinglePageAsync(resourceGroupName, expressRoutePortName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteLinkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteLinkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortImpl.java new file mode 100644 index 0000000000000..2baee175fb3e7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortImpl.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePort; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsEncapsulation; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLink; + +class ExpressRoutePortImpl extends GroupableResourceCoreImpl implements ExpressRoutePort, ExpressRoutePort.Definition, ExpressRoutePort.Update { + ExpressRoutePortImpl(String name, ExpressRoutePortInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRoutePortsInner client = this.manager().inner().expressRoutePorts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String allocationDate() { + return this.inner().allocationDate(); + } + + @Override + public Integer bandwidthInGbps() { + return this.inner().bandwidthInGbps(); + } + + @Override + public List circuits() { + return this.inner().circuits(); + } + + @Override + public ExpressRoutePortsEncapsulation encapsulation() { + return this.inner().encapsulation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String etherType() { + return this.inner().etherType(); + } + + @Override + public List links() { + List lst = new ArrayList(); + if (this.inner().links() != null) { + for (ExpressRouteLinkInner inner : this.inner().links()) { + lst.add( new ExpressRouteLinkImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String mtu() { + return this.inner().mtu(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public Double provisionedBandwidthInGbps() { + return this.inner().provisionedBandwidthInGbps(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public ExpressRoutePortImpl withBandwidthInGbps(Integer bandwidthInGbps) { + this.inner().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + @Override + public ExpressRoutePortImpl withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.inner().withEncapsulation(encapsulation); + return this; + } + + @Override + public ExpressRoutePortImpl withLinks(List links) { + this.inner().withLinks(links); + return this; + } + + @Override + public ExpressRoutePortImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRoutePortImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortInner.java new file mode 100644 index 0000000000000..08183bdb29384 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsEncapsulation; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoute Port. + * ExpressRoutePort resource definition. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRoutePortInner extends Resource { + /** + * The name of the peering location that the ExpressRoutePort is mapped to + * physically. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * Bandwidth of procured ports in Gbps. + */ + @JsonProperty(value = "properties.bandwidthInGbps") + private Integer bandwidthInGbps; + + /** + * Aggregate Gbps of associated circuit bandwidths. + */ + @JsonProperty(value = "properties.provisionedBandwidthInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Double provisionedBandwidthInGbps; + + /** + * Maximum transmission unit of the physical port pair(s). + */ + @JsonProperty(value = "properties.mtu", access = JsonProperty.Access.WRITE_ONLY) + private String mtu; + + /** + * Encapsulation method on physical ports. Possible values include: + * 'Dot1Q', 'QinQ'. + */ + @JsonProperty(value = "properties.encapsulation") + private ExpressRoutePortsEncapsulation encapsulation; + + /** + * Ether type of the physical port. + */ + @JsonProperty(value = "properties.etherType", access = JsonProperty.Access.WRITE_ONLY) + private String etherType; + + /** + * Date of the physical port allocation to be used in Letter of + * Authorization. + */ + @JsonProperty(value = "properties.allocationDate", access = JsonProperty.Access.WRITE_ONLY) + private String allocationDate; + + /** + * ExpressRouteLink Sub-Resources. + * The set of physical links of the ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.links") + private List links; + + /** + * Reference the ExpressRoute circuit(s) that are provisioned on this + * ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.circuits", access = JsonProperty.Access.WRITE_ONLY) + private List circuits; + + /** + * The provisioning state of the ExpressRoutePort resource. Possible values + * are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource GUID property of the ExpressRoutePort resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * 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 name of the peering location that the ExpressRoutePort is mapped to physically. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the name of the peering location that the ExpressRoutePort is mapped to physically. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get bandwidth of procured ports in Gbps. + * + * @return the bandwidthInGbps value + */ + public Integer bandwidthInGbps() { + return this.bandwidthInGbps; + } + + /** + * Set bandwidth of procured ports in Gbps. + * + * @param bandwidthInGbps the bandwidthInGbps value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withBandwidthInGbps(Integer bandwidthInGbps) { + this.bandwidthInGbps = bandwidthInGbps; + return this; + } + + /** + * Get aggregate Gbps of associated circuit bandwidths. + * + * @return the provisionedBandwidthInGbps value + */ + public Double provisionedBandwidthInGbps() { + return this.provisionedBandwidthInGbps; + } + + /** + * Get maximum transmission unit of the physical port pair(s). + * + * @return the mtu value + */ + public String mtu() { + return this.mtu; + } + + /** + * Get encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ'. + * + * @return the encapsulation value + */ + public ExpressRoutePortsEncapsulation encapsulation() { + return this.encapsulation; + } + + /** + * Set encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ'. + * + * @param encapsulation the encapsulation value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.encapsulation = encapsulation; + return this; + } + + /** + * Get ether type of the physical port. + * + * @return the etherType value + */ + public String etherType() { + return this.etherType; + } + + /** + * Get 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 set of physical links of the ExpressRoutePort resource. + * + * @return the links value + */ + public List links() { + return this.links; + } + + /** + * Set the set of physical links of the ExpressRoutePort resource. + * + * @param links the links value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. + * + * @return the circuits value + */ + public List circuits() { + return this.circuits; + } + + /** + * Get the provisioning state of the ExpressRoutePort resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource GUID property of the ExpressRoutePort resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the ExpressRoutePort resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsImpl.java new file mode 100644 index 0000000000000..a9b63c89a313c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePort; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRoutePortsImpl extends GroupableResourcesCoreImpl implements ExpressRoutePorts { + protected ExpressRoutePortsImpl(NetworkManager manager) { + super(manager.inner().expressRoutePorts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRoutePortsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRoutePortsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePort call(ExpressRoutePortInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRoutePortsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRoutePortsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePort call(ExpressRoutePortInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRoutePortImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRoutePortImpl wrapModel(ExpressRoutePortInner inner) { + return new ExpressRoutePortImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRoutePortImpl wrapModel(String name) { + return new ExpressRoutePortImpl(name, new ExpressRoutePortInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsInner.java new file mode 100644 index 0000000000000..087c810af0d25 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRoutePorts. + */ +public class ExpressRoutePortsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRoutePortsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRoutePortsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRoutePortsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRoutePorts to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRoutePortsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Body ExpressRoutePortInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Body ExpressRoutePortInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("expressRoutePortName") String expressRoutePortName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String expressRoutePortName) { + deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String expressRoutePortName) { + return deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String expressRoutePortName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String expressRoutePortName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner createOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update ExpressRoutePort tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String expressRoutePortName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).toBlocking().last().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update ExpressRoutePort tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortInner object if successful. + */ + public ExpressRoutePortInner beginUpdateTags(String resourceGroupName, String expressRoutePortName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).toBlocking().single().body(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags), serviceCallback); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName, tags).map(new Func1, ExpressRoutePortInner>() { + @Override + public ExpressRoutePortInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRoutePortInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (expressRoutePortName == null) { + throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, expressRoutePortName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the ExpressRoutePort resources in the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationImpl.java new file mode 100644 index 0000000000000..15feb94230d09 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocation; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocationBandwidths; + +class ExpressRoutePortsLocationImpl extends GroupableResourceCoreImpl implements ExpressRoutePortsLocation { + ExpressRoutePortsLocationImpl(String name, ExpressRoutePortsLocationInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRoutePortsLocationsInner client = this.manager().inner().expressRoutePortsLocations(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public String address() { + return this.inner().address(); + } + + @Override + public List availableBandwidths() { + return this.inner().availableBandwidths(); + } + + @Override + public String contact() { + return this.inner().contact(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationInner.java new file mode 100644 index 0000000000000..a18df7bc44142 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocationBandwidths; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRoutePorts Peering Location. + * Definition of the ExpressRoutePorts peering location resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRoutePortsLocationInner extends Resource { + /** + * Address of peering location. + */ + @JsonProperty(value = "properties.address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * Contact details of peering locations. + */ + @JsonProperty(value = "properties.contact", access = JsonProperty.Access.WRITE_ONLY) + private String contact; + + /** + * The inventory of available ExpressRoutePort bandwidths. + */ + @JsonProperty(value = "properties.availableBandwidths") + private List availableBandwidths; + + /** + * The provisioning state of the ExpressRoutePortLocation resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get address of peering location. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get contact details of peering locations. + * + * @return the contact value + */ + public String contact() { + return this.contact; + } + + /** + * Get the inventory of available ExpressRoutePort bandwidths. + * + * @return the availableBandwidths value + */ + public List availableBandwidths() { + return this.availableBandwidths; + } + + /** + * Set the inventory of available ExpressRoutePort bandwidths. + * + * @param availableBandwidths the availableBandwidths value to set + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withAvailableBandwidths(List availableBandwidths) { + this.availableBandwidths = availableBandwidths; + return this; + } + + /** + * Get the provisioning state of the ExpressRoutePortLocation resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRoutePortsLocationInner object itself. + */ + public ExpressRoutePortsLocationInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsImpl.java new file mode 100644 index 0000000000000..4b62a7a7bdaae --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocations; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocation; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRoutePortsLocationsImpl extends GroupableResourcesCoreImpl implements ExpressRoutePortsLocations { + protected ExpressRoutePortsLocationsImpl(NetworkManager manager) { + super(manager.inner().expressRoutePortsLocations(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRoutePortsLocationsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRoutePortsLocationsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRoutePortsLocationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRoutePortsLocation call(ExpressRoutePortsLocationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String locationName) { + ExpressRoutePortsLocationsInner client = this.inner(); + return client.getAsync(locationName) + .map(new Func1() { + @Override + public ExpressRoutePortsLocation call(ExpressRoutePortsLocationInner inner) { + return new ExpressRoutePortsLocationImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected ExpressRoutePortsLocationImpl wrapModel(ExpressRoutePortsLocationInner inner) { + return new ExpressRoutePortsLocationImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRoutePortsLocationImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsInner.java new file mode 100644 index 0000000000000..a1d5b4ded1894 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsLocationsInner.java @@ -0,0 +1,367 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRoutePortsLocations. + */ +public class ExpressRoutePortsLocationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRoutePortsLocationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsLocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRoutePortsLocationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRoutePortsLocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRoutePortsLocations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRoutePortsLocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocations list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocations get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortsLocationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortsLocationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRoutePortsLocationInner object if successful. + */ + public ExpressRoutePortsLocationInner get(String locationName) { + return getWithServiceResponseAsync(locationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String locationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortsLocationInner object + */ + public Observable getAsync(String locationName) { + return getWithServiceResponseAsync(locationName).map(new Func1, ExpressRoutePortsLocationInner>() { + @Override + public ExpressRoutePortsLocationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ExpressRoutePortsLocationInner object + */ + public Observable> getWithServiceResponseAsync(String locationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(this.client.subscriptionId(), locationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRoutePortsLocationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRoutePortsLocationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRoutePortsLocationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 0000000000000..eb68a44b9cb17 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProvider; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviderBandwidthsOffered; + +class ExpressRouteServiceProviderImpl extends GroupableResourceCoreImpl implements ExpressRouteServiceProvider { + ExpressRouteServiceProviderImpl(String name, ExpressRouteServiceProviderInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bandwidthsOffered() { + return this.inner().bandwidthsOffered(); + } + + @Override + public List peeringLocations() { + return this.inner().peeringLocations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderInner.java new file mode 100644 index 0000000000000..cb33d3a347c6b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProviderInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviderBandwidthsOffered; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A ExpressRouteResourceProvider object. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteServiceProviderInner extends Resource { + /** + * Get a list of peering locations. + */ + @JsonProperty(value = "properties.peeringLocations") + private List peeringLocations; + + /** + * Gets bandwidths offered. + */ + @JsonProperty(value = "properties.bandwidthsOffered") + private List bandwidthsOffered; + + /** + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get get a list of peering locations. + * + * @return the peeringLocations value + */ + public List peeringLocations() { + return this.peeringLocations; + } + + /** + * Set get a list of peering locations. + * + * @param peeringLocations the peeringLocations value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + return this; + } + + /** + * Get gets bandwidths offered. + * + * @return the bandwidthsOffered value + */ + public List bandwidthsOffered() { + return this.bandwidthsOffered; + } + + /** + * Set gets bandwidths offered. + * + * @param bandwidthsOffered the bandwidthsOffered value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withBandwidthsOffered(List bandwidthsOffered) { + this.bandwidthsOffered = bandwidthsOffered; + return this; + } + + /** + * Get gets the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersImpl.java new file mode 100644 index 0000000000000..1cb058314b553 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProvider; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteServiceProvidersImpl extends GroupableResourcesCoreImpl implements ExpressRouteServiceProviders { + protected ExpressRouteServiceProvidersImpl(NetworkManager manager) { + super(manager.inner().expressRouteServiceProviders(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteServiceProvidersInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRouteServiceProvidersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteServiceProvidersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteServiceProvider call(ExpressRouteServiceProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(ExpressRouteServiceProviderInner inner) { + return new ExpressRouteServiceProviderImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersInner.java new file mode 100644 index 0000000000000..65dc3f871da12 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRouteServiceProvidersInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteServiceProviders. + */ +public class ExpressRouteServiceProvidersInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteServiceProvidersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteServiceProvidersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteServiceProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteServiceProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteServiceProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviders list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviders listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationImpl.java new file mode 100644 index 0000000000000..0c1a0ad6b311a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.FlowLogInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.TrafficAnalyticsProperties; +import com.microsoft.azure.management.network.v2019_02_01.FlowLogFormatParameters; +import com.microsoft.azure.management.network.v2019_02_01.RetentionPolicyParameters; + +class FlowLogInformationImpl extends WrapperImpl implements FlowLogInformation { + private final NetworkManager manager; + FlowLogInformationImpl(FlowLogInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public boolean enabled() { + return this.inner().enabled(); + } + + @Override + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.inner().flowAnalyticsConfiguration(); + } + + @Override + public FlowLogFormatParameters format() { + return this.inner().format(); + } + + @Override + public RetentionPolicyParameters retentionPolicy() { + return this.inner().retentionPolicy(); + } + + @Override + public String storageId() { + return this.inner().storageId(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationInner.java new file mode 100644 index 0000000000000..d6ad7c5d28653 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FlowLogInformationInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.RetentionPolicyParameters; +import com.microsoft.azure.management.network.v2019_02_01.FlowLogFormatParameters; +import com.microsoft.azure.management.network.v2019_02_01.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information on the configuration of flow log and traffic analytics + * (optional) . + */ +@JsonFlatten +public class FlowLogInformationInner { + /** + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * Parameters that define the retention policy for flow log. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /** + * Parameters that define the flow log format. + */ + @JsonProperty(value = "properties.format") + private FlowLogFormatParameters format; + + /** + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /** + * Get 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 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 iD of the storage account which is used to store the flow log. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set iD of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get flag to enable/disable flow logging. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable flow logging. + * + * @param enabled the enabled value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set parameters that define the retention policy for flow log. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get parameters that define the flow log format. + * + * @return the format value + */ + public FlowLogFormatParameters format() { + return this.format; + } + + /** + * Set parameters that define the flow log format. + * + * @param format the format value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFormat(FlowLogFormatParameters format) { + this.format = format; + return this; + } + + /** + * Get parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationImpl.java new file mode 100644 index 0000000000000..32423908e9d66 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.FrontendIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class FrontendIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements FrontendIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String frontendIPConfigurationName; + + FrontendIPConfigurationImpl(FrontendIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.frontendIPConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "frontendIPConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerFrontendIPConfigurationsInner client = this.manager().inner().loadBalancerFrontendIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.frontendIPConfigurationName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + return this.inner().inboundNatRules(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + return this.inner().outboundRules(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List zones() { + return this.inner().zones(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationInner.java new file mode 100644 index 0000000000000..0750352f1a059 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/FrontendIPConfigurationInner.java @@ -0,0 +1,320 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP address of the load balancer. + */ +@JsonFlatten +public class FrontendIPConfigurationInner extends SubResource { + /** + * Read only. Inbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /** + * Read only. Inbound pools URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /** + * Read only. Outbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.outboundRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundRules; + + /** + * Gets load balancing rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The Private IP allocation method. Possible values include: 'Static', + * 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the Public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * The reference of the Public IP Prefix resource. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + 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; + + /** + * Get read only. Inbound rules URIs that use this frontend IP. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get read only. Inbound pools URIs that use this frontend IP. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Get read only. Outbound rules URIs that use this frontend IP. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Get gets load balancing rules URIs that use this frontend IP. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the Private IP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the Private IP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the Public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the Public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the reference of the Public IP Prefix resource. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the reference of the Public IP Prefix resource. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultImpl.java new file mode 100644 index 0000000000000..7e8996487958e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.GatewayRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.GatewayRoute; + +class GatewayRouteListResultImpl extends WrapperImpl implements GatewayRouteListResult { + private final NetworkManager manager; + GatewayRouteListResultImpl(GatewayRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultInner.java new file mode 100644 index 0000000000000..b94c6b2a8b091 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/GatewayRouteListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of virtual network gateway routes. + */ +public class GatewayRouteListResultInner { + /** + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of gateway routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..89f29f2c9e681 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnection; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.SubResource; + +class HubVirtualNetworkConnectionImpl extends IndexableRefreshableWrapperImpl implements HubVirtualNetworkConnection { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualHubName; + private String connectionName; + + HubVirtualNetworkConnectionImpl(HubVirtualNetworkConnectionInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualHubs"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "hubVirtualNetworkConnections"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + HubVirtualNetworkConnectionsInner client = this.manager().inner().hubVirtualNetworkConnections(); + return client.getAsync(this.resourceGroupName, this.virtualHubName, this.connectionName); + } + + + + @Override + public Boolean allowHubToRemoteVnetTransit() { + return this.inner().allowHubToRemoteVnetTransit(); + } + + @Override + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.inner().allowRemoteVnetToUseHubVnetGateways(); + } + + @Override + public Boolean enableInternetSecurity() { + return this.inner().enableInternetSecurity(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionInner.java new file mode 100644 index 0000000000000..0aef0a819d7da --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * HubVirtualNetworkConnection Resource. + */ +@JsonFlatten +public class HubVirtualNetworkConnectionInner extends SubResource { + /** + * Reference to the remote virtual network. + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "properties.allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /** + * Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "properties.allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /** + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set reference to the remote virtual network. + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get virtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value + */ + public Boolean allowHubToRemoteVnetTransit() { + return this.allowHubToRemoteVnetTransit; + } + + /** + * Set virtualHub to RemoteVnet transit to enabled or not. + * + * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { + this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + return this; + } + + /** + * Get allow RemoteVnet to use Virtual Hub's gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value + */ + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.allowRemoteVnetToUseHubVnetGateways; + } + + /** + * Set allow RemoteVnet to use Virtual Hub's gateways. + * + * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways(Boolean allowRemoteVnetToUseHubVnetGateways) { + this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + return this; + } + + /** + * Get enable internet security. + * + * @return the enableInternetSecurity value + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsImpl.java new file mode 100644 index 0000000000000..c1b4d82453534 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnections; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnection; + +class HubVirtualNetworkConnectionsImpl extends WrapperImpl implements HubVirtualNetworkConnections { + private final NetworkManager manager; + + HubVirtualNetworkConnectionsImpl(NetworkManager manager) { + super(manager.inner().hubVirtualNetworkConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private HubVirtualNetworkConnectionImpl wrapModel(HubVirtualNetworkConnectionInner inner) { + return new HubVirtualNetworkConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualHubName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualHubName, connectionName) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsInner.java new file mode 100644 index 0000000000000..fb18749979b5d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/HubVirtualNetworkConnectionsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HubVirtualNetworkConnections. + */ +public class HubVirtualNetworkConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private HubVirtualNetworkConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HubVirtualNetworkConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(HubVirtualNetworkConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HubVirtualNetworkConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface HubVirtualNetworkConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HubVirtualNetworkConnectionInner object if successful. + */ + public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualHubName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).map(new Func1, HubVirtualNetworkConnectionInner>() { + @Override + public HubVirtualNetworkConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualHubName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualHubName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualHubName) { + return listWithServiceResponseAsync(resourceGroupName, virtualHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualHubName) { + return listSinglePageAsync(resourceGroupName, virtualHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + ServiceResponse> * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..361a92158573a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.IPAddressAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class IPAddressAvailabilityResultImpl extends WrapperImpl implements IPAddressAvailabilityResult { + private final NetworkManager manager; + IPAddressAvailabilityResultImpl(IPAddressAvailabilityResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean available() { + return this.inner().available(); + } + + @Override + public List availableIPAddresses() { + return this.inner().availableIPAddresses(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultInner.java new file mode 100644 index 0000000000000..7aeaa5e1eec31 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IPAddressAvailabilityResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for CheckIPAddressAvailability API service call. + */ +public class IPAddressAvailabilityResultInner { + /** + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIPAddresses; + + /** + * Get private IP address availability. + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set 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 contains other available private IP addresses if the asked for address is taken. + * + * @return the availableIPAddresses value + */ + public List availableIPAddresses() { + return this.availableIPAddresses; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IdParsingUtils.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..a3e0b54a28ae9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..e707ce4777c77 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.TransportProtocol; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class InboundNatRuleImpl extends CreatableUpdatableImpl implements InboundNatRule, InboundNatRule.Definition, InboundNatRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String inboundNatRuleName; + + InboundNatRuleImpl(String name, NetworkManager manager) { + super(name, new InboundNatRuleInner()); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = name; + // + } + + InboundNatRuleImpl(InboundNatRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.inboundNatRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "inboundNatRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().backendIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public Integer frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public InboundNatRuleImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + @Override + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.inner().withBackendPort(backendPort); + return this; + } + + @Override + public InboundNatRuleImpl withEnableFloatingIP(Boolean enableFloatingIP) { + this.inner().withEnableFloatingIP(enableFloatingIP); + return this; + } + + @Override + public InboundNatRuleImpl withEnableTcpReset(Boolean enableTcpReset) { + this.inner().withEnableTcpReset(enableTcpReset); + return this; + } + + @Override + public InboundNatRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.inner().withFrontendIPConfiguration(frontendIPConfiguration); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.inner().withFrontendPort(frontendPort); + return this; + } + + @Override + public InboundNatRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public InboundNatRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public InboundNatRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleInner.java new file mode 100644 index 0000000000000..1c7ca1e8e6146 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRuleInner.java @@ -0,0 +1,311 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT rule of the load balancer. + */ +@JsonFlatten +public class InboundNatRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP + * configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "properties.backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIPConfigurationInner backendIPConfiguration; + + /** + * The reference to the transport protocol used by the load balancing rule. + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values range from 1 to + * 65534. + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /** + * The port used for the internal endpoint. Acceptable values range from 1 + * to 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets 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") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get 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 reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @param frontendPort the frontendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the 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 port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the 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 timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get 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 configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get 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 receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesImpl.java new file mode 100644 index 0000000000000..3ded187f9c794 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; + +class InboundNatRulesImpl extends WrapperImpl implements InboundNatRules { + private final NetworkManager manager; + + InboundNatRulesImpl(NetworkManager manager) { + super(manager.inner().inboundNatRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public InboundNatRuleImpl define(String name) { + return wrapModel(name); + } + + private InboundNatRuleImpl wrapModel(InboundNatRuleInner inner) { + return new InboundNatRuleImpl(inner, manager()); + } + + private InboundNatRuleImpl wrapModel(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + InboundNatRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesInner.java new file mode 100644 index 0000000000000..6f281d13b52f7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InboundNatRulesInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InboundNatRules. + */ +public class InboundNatRulesInner { + /** The Retrofit service to perform REST calls. */ + private InboundNatRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InboundNatRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InboundNatRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for InboundNatRules to be + * used by Retrofit to perform actually REST calls. + */ + interface InboundNatRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InboundNatRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner createOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the InboundNatRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointImpl.java new file mode 100644 index 0000000000000..2367002932ef2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoint; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.EndpointService; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterface; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class InterfaceEndpointImpl extends GroupableResourceCoreImpl implements InterfaceEndpoint, InterfaceEndpoint.Definition, InterfaceEndpoint.Update { + InterfaceEndpointImpl(String name, InterfaceEndpointInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InterfaceEndpointsInner client = this.manager().inner().interfaceEndpoints(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public EndpointService endpointService() { + return this.inner().endpointService(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String fqdn() { + return this.inner().fqdn(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String owner() { + return this.inner().owner(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public InterfaceEndpointImpl withEndpointService(EndpointService endpointService) { + this.inner().withEndpointService(endpointService); + return this; + } + + @Override + public InterfaceEndpointImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InterfaceEndpointImpl withFqdn(String fqdn) { + this.inner().withFqdn(fqdn); + return this; + } + + @Override + public InterfaceEndpointImpl withSubnet(SubnetInner subnet) { + this.inner().withSubnet(subnet); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointInner.java new file mode 100644 index 0000000000000..cdc6c389e8e69 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointInner.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.EndpointService; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Interface endpoint resource. + */ +@JsonFlatten +@SkipParentValidation +public class InterfaceEndpointInner extends Resource { + /** + * A first-party service's FQDN that is mapped to the private IP allocated + * via this interface endpoint. + */ + @JsonProperty(value = "properties.fqdn") + private String fqdn; + + /** + * A reference to the service being brought into the virtual network. + */ + @JsonProperty(value = "properties.endpointService") + private EndpointService endpointService; + + /** + * The ID of the subnet from which the private IP will be allocated. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets an array of references to the network interfaces created for this + * interface endpoint. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A read-only property that identifies who created this interface + * endpoint. + */ + @JsonProperty(value = "properties.owner", access = JsonProperty.Access.WRITE_ONLY) + private String owner; + + /** + * The provisioning state of the interface endpoint. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set a first-party service's FQDN that is mapped to the private IP allocated via this interface endpoint. + * + * @param fqdn the fqdn value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get a reference to the service being brought into the virtual network. + * + * @return the endpointService value + */ + public EndpointService endpointService() { + return this.endpointService; + } + + /** + * Set a reference to the service being brought into the virtual network. + * + * @param endpointService the endpointService value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withEndpointService(EndpointService endpointService) { + this.endpointService = endpointService; + return this; + } + + /** + * Get 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 ID of the subnet from which the private IP will be allocated. + * + * @param subnet the subnet value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets an array of references to the network interfaces created for this interface endpoint. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a read-only property that identifies who created this interface endpoint. + * + * @return the owner value + */ + public String owner() { + return this.owner; + } + + /** + * Get the provisioning state of the interface endpoint. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the InterfaceEndpointInner object itself. + */ + public InterfaceEndpointInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsImpl.java new file mode 100644 index 0000000000000..158b291f08326 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoint; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class InterfaceEndpointsImpl extends GroupableResourcesCoreImpl implements InterfaceEndpoints { + protected InterfaceEndpointsImpl(NetworkManager manager) { + super(manager.inner().interfaceEndpoints(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + InterfaceEndpointsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + InterfaceEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + InterfaceEndpointsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + InterfaceEndpointsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InterfaceEndpoint call(InterfaceEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + InterfaceEndpointsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + InterfaceEndpointsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InterfaceEndpoint call(InterfaceEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public InterfaceEndpointImpl define(String name) { + return wrapModel(name); + } + + @Override + protected InterfaceEndpointImpl wrapModel(InterfaceEndpointInner inner) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } + + @Override + protected InterfaceEndpointImpl wrapModel(String name) { + return new InterfaceEndpointImpl(name, new InterfaceEndpointInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsInner.java new file mode 100644 index 0000000000000..36bb3a6fde1e4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/InterfaceEndpointsInner.java @@ -0,0 +1,1030 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InterfaceEndpoints. + */ +public class InterfaceEndpointsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private InterfaceEndpointsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InterfaceEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InterfaceEndpointsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InterfaceEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for InterfaceEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface InterfaceEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Body InterfaceEndpointInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("interfaceEndpointName") String interfaceEndpointName, @Path("subscriptionId") String subscriptionId, @Body InterfaceEndpointInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/interfaceEndpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String interfaceEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().last().body(); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String interfaceEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String interfaceEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().single().body(); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String interfaceEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified interface endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).toBlocking().single().body(); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName), serviceCallback); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner getByResourceGroup(String resourceGroupName, String interfaceEndpointName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand), serviceCallback); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String interfaceEndpointName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, expand).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified interface endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner createOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters), serviceCallback); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InterfaceEndpointInner object if successful. + */ + public InterfaceEndpointInner beginCreateOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters), serviceCallback); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).map(new Func1, InterfaceEndpointInner>() { + @Override + public InterfaceEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an interface endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param interfaceEndpointName The name of the interface endpoint. + * @param parameters Parameters supplied to the create or update interface endpoint operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (interfaceEndpointName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InterfaceEndpointInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all interface endpoints in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsImpl.java new file mode 100644 index 0000000000000..9cc1c070d4732 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerBackendAddressPools; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; + +class LoadBalancerBackendAddressPoolsImpl extends WrapperImpl implements LoadBalancerBackendAddressPools { + private final NetworkManager manager; + + LoadBalancerBackendAddressPoolsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerBackendAddressPools()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private BackendAddressPoolImpl wrapModel(BackendAddressPoolInner inner) { + return new BackendAddressPoolImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsInner.java new file mode 100644 index 0000000000000..0f64939bea410 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerBackendAddressPoolsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerBackendAddressPools. + */ +public class LoadBalancerBackendAddressPoolsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerBackendAddressPoolsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerBackendAddressPoolsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerBackendAddressPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerBackendAddressPools to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerBackendAddressPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerBackendAddressPools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerBackendAddressPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("backendAddressPoolName") String backendAddressPoolName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerBackendAddressPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackendAddressPoolInner object if successful. + */ + public BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName), serviceCallback); + } + + /** + * 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 + * @return the observable to the BackendAddressPoolInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).map(new Func1, BackendAddressPoolInner>() { + @Override + public BackendAddressPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the BackendAddressPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (backendAddressPoolName == null) { + throw new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, backendAddressPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java new file mode 100644 index 0000000000000..a0f47d374505e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerFrontendIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.FrontendIPConfiguration; + +class LoadBalancerFrontendIPConfigurationsImpl extends WrapperImpl implements LoadBalancerFrontendIPConfigurations { + private final NetworkManager manager; + + LoadBalancerFrontendIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerFrontendIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private FrontendIPConfigurationImpl wrapModel(FrontendIPConfigurationInner inner) { + return new FrontendIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java new file mode 100644 index 0000000000000..69e38887926f5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerFrontendIPConfigurations. + */ +public class LoadBalancerFrontendIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerFrontendIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerFrontendIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerFrontendIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerFrontendIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerFrontendIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerFrontendIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerFrontendIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("frontendIPConfigurationName") String frontendIPConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerFrontendIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FrontendIPConfigurationInner object if successful. + */ + public FrontendIPConfigurationInner get(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).map(new Func1, FrontendIPConfigurationInner>() { + @Override + public FrontendIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (frontendIPConfigurationName == null) { + throw new IllegalArgumentException("Parameter frontendIPConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerImpl.java new file mode 100644 index 0000000000000..351dd58e754f8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancer; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2019_02_01.OutboundRule; +import com.microsoft.azure.management.network.v2019_02_01.Probe; + +class LoadBalancerImpl extends GroupableResourceCoreImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + LoadBalancerImpl(String name, LoadBalancerInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List outboundRules() { + List lst = new ArrayList(); + if (this.inner().outboundRules() != null) { + for (OutboundRuleInner inner : this.inner().outboundRules()) { + lst.add( new OutboundRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public LoadBalancerImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LoadBalancerImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.inner().withInboundNatPools(inboundNatPools); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.inner().withInboundNatRules(inboundNatRules); + return this; + } + + @Override + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.inner().withLoadBalancingRules(loadBalancingRules); + return this; + } + + @Override + public LoadBalancerImpl withOutboundRules(List outboundRules) { + this.inner().withOutboundRules(outboundRules); + return this; + } + + @Override + public LoadBalancerImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public LoadBalancerImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public LoadBalancerImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerInner.java new file mode 100644 index 0000000000000..c0d2731d9bf54 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerInner.java @@ -0,0 +1,351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatPool; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * LoadBalancer resource. + */ +@JsonFlatten +@SkipParentValidation +public class LoadBalancerInner extends Resource { + /** + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /** + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Object collection representing the load balancing rules Gets the + * provisioning. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /** + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with + * defining an inbound NAT pool. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to + * reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatRules") + private List inboundNatRules; + + /** + * Defines an external port range for inbound NAT to a single backend port + * on NICs associated with a load balancer. Inbound NAT rules are created + * automatically for each NIC associated with the Load Balancer using an + * external port from this range. Defining an Inbound NAT pool on your Load + * Balancer is mutually exclusive with defining inbound Nat rules. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are + * associated with individual virtual machines cannot reference an inbound + * NAT pool. They have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatPools") + private List inboundNatPools; + + /** + * The outbound rules. + */ + @JsonProperty(value = "properties.outboundRules") + private List outboundRules; + + /** + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the load balancer SKU. + * + * @return the sku value + */ + public LoadBalancerSku sku() { + return this.sku; + } + + /** + * Set 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 object representing the frontend IPs to be used for the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set object representing the frontend IPs to be used for the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set collection of backend address pools used by a load balancer. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get object collection representing the load balancing rules Gets the provisioning. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set object collection representing the load balancing rules Gets the provisioning. + * + * @param loadBalancingRules the loadBalancingRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get collection of probe objects used in the load balancer. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set collection of probe objects used in the load balancer. + * + * @param probes the probes value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get 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 collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatRules(List inboundNatRules) { + this.inboundNatRules = inboundNatRules; + return this; + } + + /** + * Get 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 defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatPools the inboundNatPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + + /** + * Get the outbound rules. + * + * @return the outboundRules value + */ + public List outboundRules() { + return this.outboundRules; + } + + /** + * Set the outbound rules. + * + * @param outboundRules the outboundRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withOutboundRules(List outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the resource GUID property of the load balancer resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the load balancer resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesImpl.java new file mode 100644 index 0000000000000..18bb4fb20654d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerLoadBalancingRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancingRule; + +class LoadBalancerLoadBalancingRulesImpl extends WrapperImpl implements LoadBalancerLoadBalancingRules { + private final NetworkManager manager; + + LoadBalancerLoadBalancingRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerLoadBalancingRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancingRuleImpl wrapModel(LoadBalancingRuleInner inner) { + return new LoadBalancingRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesInner.java new file mode 100644 index 0000000000000..a2f75061e8c86 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerLoadBalancingRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerLoadBalancingRules. + */ +public class LoadBalancerLoadBalancingRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerLoadBalancingRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerLoadBalancingRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerLoadBalancingRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerLoadBalancingRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerLoadBalancingRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerLoadBalancingRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerLoadBalancingRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("loadBalancingRuleName") String loadBalancingRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerLoadBalancingRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancingRuleInner object if successful. + */ + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).map(new Func1, LoadBalancingRuleInner>() { + @Override + public LoadBalancingRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (loadBalancingRuleName == null) { + throw new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, loadBalancingRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfaceImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfaceImpl.java new file mode 100644 index 0000000000000..c034a4af69537 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfaceImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoint; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroup; +import java.util.Map; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfiguration; +import com.microsoft.azure.SubResource; + +class LoadBalancerNetworkInterfaceImpl extends WrapperImpl implements LoadBalancerNetworkInterface { + private final NetworkManager manager; + + LoadBalancerNetworkInterfaceImpl(NetworkInterfaceInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hostedWorkloads() { + return this.inner().hostedWorkloads(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public InterfaceEndpoint interfaceEndpoint() { + InterfaceEndpointInner inner = this.inner().interfaceEndpoint(); + if (inner != null) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tapConfigurations() { + List lst = new ArrayList(); + if (this.inner().tapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().tapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesImpl.java new file mode 100644 index 0000000000000..ed374229e58b3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterface; + +class LoadBalancerNetworkInterfacesImpl extends WrapperImpl implements LoadBalancerNetworkInterfaces { + private final NetworkManager manager; + + LoadBalancerNetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerNetworkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancerNetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerNetworkInterfacesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesInner.java new file mode 100644 index 0000000000000..2ae8ee8e22b9b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerNetworkInterfacesInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerNetworkInterfaces. + */ +public class LoadBalancerNetworkInterfacesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerNetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerNetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerNetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerNetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerNetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesImpl.java new file mode 100644 index 0000000000000..d2ee6c2b37e05 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.OutboundRule; + +class LoadBalancerOutboundRulesImpl extends WrapperImpl implements LoadBalancerOutboundRules { + private final NetworkManager manager; + + LoadBalancerOutboundRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerOutboundRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private OutboundRuleImpl wrapModel(OutboundRuleInner inner) { + return new OutboundRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerOutboundRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OutboundRule call(OutboundRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + LoadBalancerOutboundRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, outboundRuleName) + .map(new Func1() { + @Override + public OutboundRule call(OutboundRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesInner.java new file mode 100644 index 0000000000000..e9b622dbe9f01 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerOutboundRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerOutboundRules. + */ +public class LoadBalancerOutboundRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerOutboundRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerOutboundRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerOutboundRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerOutboundRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerOutboundRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerOutboundRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("outboundRuleName") String outboundRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OutboundRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OutboundRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OutboundRuleInner object if successful. + */ + public OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the OutboundRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName).map(new Func1, OutboundRuleInner>() { + @Override + public OutboundRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the OutboundRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (outboundRuleName == null) { + throw new IllegalArgumentException("Parameter outboundRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, outboundRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OutboundRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OutboundRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the outbound rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OutboundRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesImpl.java new file mode 100644 index 0000000000000..981e581da5b8a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerProbes; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.Probe; + +class LoadBalancerProbesImpl extends WrapperImpl implements LoadBalancerProbes { + private final NetworkManager manager; + + LoadBalancerProbesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerProbes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ProbeImpl wrapModel(ProbeInner inner) { + return new ProbeImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerProbesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + LoadBalancerProbesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, probeName) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesInner.java new file mode 100644 index 0000000000000..f2f796d70e810 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancerProbesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerProbes. + */ +public class LoadBalancerProbesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerProbesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerProbesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerProbesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerProbes to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerProbesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerProbes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerProbes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("probeName") String probeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancerProbes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProbeInner object if successful. + */ + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String probeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ProbeInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).map(new Func1, ProbeInner>() { + @Override + public ProbeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ProbeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String probeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (probeName == null) { + throw new IllegalArgumentException("Parameter probeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, loadBalancerName, probeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersImpl.java new file mode 100644 index 0000000000000..e5b0cd481bee6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancers; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancer; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LoadBalancersImpl extends GroupableResourcesCoreImpl implements LoadBalancers { + protected LoadBalancersImpl(NetworkManager manager) { + super(manager.inner().loadBalancers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + LoadBalancersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LoadBalancerImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new LoadBalancerImpl(inner.name(), inner, manager()); + } + + @Override + protected LoadBalancerImpl wrapModel(String name) { + return new LoadBalancerImpl(name, new LoadBalancerInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersInner.java new file mode 100644 index 0000000000000..fb63697870ace --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancersInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancers. + */ +public class LoadBalancersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private LoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LoadBalancers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a load balancer tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a load balancer tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 0000000000000..651aa62ecc382 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancingRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.LoadDistribution; +import com.microsoft.azure.management.network.v2019_02_01.TransportProtocol; + +class LoadBalancingRuleImpl extends IndexableRefreshableWrapperImpl implements LoadBalancingRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String loadBalancingRuleName; + + LoadBalancingRuleImpl(LoadBalancingRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.loadBalancingRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancingRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerLoadBalancingRulesInner client = this.manager().inner().loadBalancerLoadBalancingRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.loadBalancingRuleName); + } + + + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean disableOutboundSnat() { + return this.inner().disableOutboundSnat(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public int frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public LoadDistribution loadDistribution() { + return this.inner().loadDistribution(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource probe() { + return this.inner().probe(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleInner.java new file mode 100644 index 0000000000000..131a43f2758a9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LoadBalancingRuleInner.java @@ -0,0 +1,404 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.TransportProtocol; +import com.microsoft.azure.management.network.v2019_02_01.LoadDistribution; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancing rule for a load balancer. + */ +@JsonFlatten +public class LoadBalancingRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * The reference of the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * The reference to the transport protocol used by the load balancing rule. + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The load distribution policy for this rule. Possible values are + * 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: + * 'Default', 'SourceIP', 'SourceIPProtocol'. + */ + @JsonProperty(value = "properties.loadDistribution") + private LoadDistribution loadDistribution; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 0 and + * 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.frontendPort", 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 = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is + * set to TCP. + */ + @JsonProperty(value = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + */ + @JsonProperty(value = "properties.disableOutboundSnat") + private Boolean disableOutboundSnat; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get 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 a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the reference of the load balancer probe used by the load balancing rule. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the reference of the load balancer probe used by the load balancing rule. + * + * @param probe the probe value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get the reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set the reference to the transport protocol used by the load balancing rule. Possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @return the loadDistribution value + */ + public LoadDistribution loadDistribution() { + return this.loadDistribution; + } + + /** + * Set the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @param loadDistribution the loadDistribution value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { + this.loadDistribution = loadDistribution; + return this; + } + + /** + * Get 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 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(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get 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 port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @param backendPort the backendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the 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 timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get 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 configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get 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 receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get 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 configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @param disableOutboundSnat the disableOutboundSnat value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { + this.disableOutboundSnat = disableOutboundSnat; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayImpl.java new file mode 100644 index 0000000000000..6a0e9f86520fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; + +class LocalNetworkGatewayImpl extends GroupableResourceCoreImpl implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + LocalNetworkGatewayImpl(String name, LocalNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayIpAddress() { + return this.inner().gatewayIpAddress(); + } + + @Override + public AddressSpace localNetworkAddressSpace() { + return this.inner().localNetworkAddressSpace(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public LocalNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.inner().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + @Override + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.inner().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + @Override + public LocalNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayInner.java new file mode 100644 index 0000000000000..3a358ed22d276 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewayInner.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class LocalNetworkGatewayInner extends Resource { + /** + * Local network site address space. + */ + @JsonProperty(value = "properties.localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /** + * IP address of local network gateway. + */ + @JsonProperty(value = "properties.gatewayIpAddress") + private String gatewayIpAddress; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the LocalNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the LocalNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get local network site address space. + * + * @return the localNetworkAddressSpace value + */ + public AddressSpace localNetworkAddressSpace() { + return this.localNetworkAddressSpace; + } + + /** + * Set local network site address space. + * + * @param localNetworkAddressSpace the localNetworkAddressSpace value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.localNetworkAddressSpace = localNetworkAddressSpace; + return this; + } + + /** + * Get iP address of local network gateway. + * + * @return the gatewayIpAddress value + */ + public String gatewayIpAddress() { + return this.gatewayIpAddress; + } + + /** + * Set iP address of local network gateway. + * + * @param gatewayIpAddress the gatewayIpAddress value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { + this.gatewayIpAddress = gatewayIpAddress; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the LocalNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the LocalNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..1e37ad44b2f89 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LocalNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements LocalNetworkGateways { + protected LocalNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().localNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocalNetworkGateway call(LocalNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LocalNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(LocalNetworkGatewayInner inner) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(String name) { + return new LocalNetworkGatewayImpl(name, new LocalNetworkGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysInner.java new file mode 100644 index 0000000000000..4953da67e8dce --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocalNetworkGatewaysInner.java @@ -0,0 +1,1048 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocalNetworkGateways. + */ +public class LocalNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private LocalNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocalNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LocalNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocalNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface LocalNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String localNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String localNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a local network gateway tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a local network gateway tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @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 + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationImpl.java new file mode 100644 index 0000000000000..96994c97596ba --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.LocationAvailableDelegation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; + +class LocationAvailableDelegationImpl extends WrapperImpl implements LocationAvailableDelegation { + private final NetworkManager manager; + + LocationAvailableDelegationImpl(AvailableDelegationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationModelImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationModelImpl.java new file mode 100644 index 0000000000000..3dd4d95372b55 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/LocationAvailableDelegationModelImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.LocationAvailableDelegationModel; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; + +class LocationAvailableDelegationModelImpl extends WrapperImpl implements LocationAvailableDelegationModel { + private final NetworkManager manager; + + LocationAvailableDelegationModelImpl(AvailableDelegationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayImpl.java new file mode 100644 index 0000000000000..806b9db61a9cb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayImpl.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NatGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.NatGatewaySku; +import java.util.List; +import com.microsoft.azure.SubResource; + +class NatGatewayImpl extends GroupableResourceCoreImpl implements NatGateway, NatGateway.Definition, NatGateway.Update { + NatGatewayImpl(String name, NatGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NatGatewaysInner client = this.manager().inner().natGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NatGatewaysInner client = this.manager().inner().natGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NatGatewaysInner client = this.manager().inner().natGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List publicIpAddresses() { + return this.inner().publicIpAddresses(); + } + + @Override + public List publicIpPrefixes() { + return this.inner().publicIpPrefixes(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public NatGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public List subnets() { + return this.inner().subnets(); + } + + @Override + public NatGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NatGatewayImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public NatGatewayImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NatGatewayImpl withPublicIpAddresses(List publicIpAddresses) { + this.inner().withPublicIpAddresses(publicIpAddresses); + return this; + } + + @Override + public NatGatewayImpl withPublicIpPrefixes(List publicIpPrefixes) { + this.inner().withPublicIpPrefixes(publicIpPrefixes); + return this; + } + + @Override + public NatGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NatGatewayImpl withSku(NatGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayInner.java new file mode 100644 index 0000000000000..c541278f46b7a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewayInner.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NatGatewaySku; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Nat Gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class NatGatewayInner extends Resource { + /** + * The nat gateway SKU. + */ + @JsonProperty(value = "sku") + private NatGatewaySku sku; + + /** + * The idle timeout of the nat gateway. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * An array of public ip addresses associated with the nat gateway + * resource. + */ + @JsonProperty(value = "properties.publicIpAddresses") + private List publicIpAddresses; + + /** + * An array of public ip prefixes associated with the nat gateway resource. + */ + @JsonProperty(value = "properties.publicIpPrefixes") + private List publicIpPrefixes; + + /** + * An array of references to the subnets using this nat gateway resource. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the nat gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the NatGateway resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the nat gateway SKU. + * + * @return the sku value + */ + public NatGatewaySku sku() { + return this.sku; + } + + /** + * Set 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 idle timeout of the nat gateway. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idle timeout of the nat gateway. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get an array of public ip addresses associated with the nat gateway resource. + * + * @return the publicIpAddresses value + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Set an array of public ip addresses associated with the nat gateway resource. + * + * @param publicIpAddresses the publicIpAddresses value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withPublicIpAddresses(List publicIpAddresses) { + this.publicIpAddresses = publicIpAddresses; + return this; + } + + /** + * Get an array of public ip prefixes associated with the nat gateway resource. + * + * @return the publicIpPrefixes value + */ + public List publicIpPrefixes() { + return this.publicIpPrefixes; + } + + /** + * Set an array of public ip prefixes associated with the nat gateway resource. + * + * @param publicIpPrefixes the publicIpPrefixes value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withPublicIpPrefixes(List publicIpPrefixes) { + this.publicIpPrefixes = publicIpPrefixes; + return this; + } + + /** + * Get an array of references to the subnets using this nat gateway resource. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the nat gateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the nat gateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the NatGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the NatGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NatGatewayInner object itself. + */ + public NatGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysImpl.java new file mode 100644 index 0000000000000..2018fe04a8301 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NatGateways; +import com.microsoft.azure.management.network.v2019_02_01.NatGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NatGatewaysImpl extends GroupableResourcesCoreImpl implements NatGateways { + protected NatGatewaysImpl(NetworkManager manager) { + super(manager.inner().natGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NatGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NatGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NatGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NatGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NatGateway call(NatGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NatGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NatGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NatGateway call(NatGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NatGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NatGatewayImpl wrapModel(NatGatewayInner inner) { + return new NatGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected NatGatewayImpl wrapModel(String name) { + return new NatGatewayImpl(name, new NatGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysInner.java new file mode 100644 index 0000000000000..0929d429974f1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NatGatewaysInner.java @@ -0,0 +1,1209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NatGateways. + */ +public class NatGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NatGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NatGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NatGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NatGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for NatGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface NatGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Body NatGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Body NatGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("natGatewayName") String natGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NatGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String natGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, natGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String natGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, natGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String natGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, natGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String natGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String natGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, natGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String natGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, natGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String natGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, natGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String natGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String natGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String natGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String natGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String natGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String natGatewayName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, natGatewayName, expand).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String natGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner createOrUpdate(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, natGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner beginCreateOrUpdate(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, natGatewayName, parameters).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NatGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, natGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates nat gateway tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner updateTags(String resourceGroupName, String natGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName).toBlocking().single().body(); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String natGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName), serviceCallback); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NatGatewayInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String natGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NatGatewayInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String natGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NatGatewayInner object if successful. + */ + public NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String natGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName, tags), serviceCallback); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NatGatewayInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String natGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, natGatewayName, tags).map(new Func1, NatGatewayInner>() { + @Override + public NatGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NatGatewayInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String natGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (natGatewayName == null) { + throw new IllegalArgumentException("Parameter natGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, natGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NatGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NatGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NatGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all nat gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NatGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NatGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NatGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NatGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all nat gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NatGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all nat gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NatGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..b3a4294ab7d4f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticResult; + +class NetworkConfigurationDiagnosticResponseImpl extends WrapperImpl implements NetworkConfigurationDiagnosticResponse { + private final NetworkManager manager; + NetworkConfigurationDiagnosticResponseImpl(NetworkConfigurationDiagnosticResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List results() { + return this.inner().results(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 0000000000000..bf756de075615 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of network configuration diagnostic on the target resource. + */ +public class NetworkConfigurationDiagnosticResponseInner { + /** + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get list of network configuration diagnostic results. + * + * @return the results value + */ + public List results() { + return this.results; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationInner.java new file mode 100644 index 0000000000000..1508a967f2dc1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationInner.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IPConfiguration in a network interface. + */ +@JsonFlatten +public class NetworkInterfaceIPConfigurationInner extends SubResource { + /** + * The reference to Virtual Network Taps. + */ + @JsonProperty(value = "properties.virtualNetworkTaps") + private List virtualNetworkTaps; + + /** + * The reference of ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /** + * The reference of LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /** + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP address allocation method. Possible values include: + * 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Available from Api-Version 2016-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IPVersion privateIPAddressVersion; + + /** + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets whether this is a primary customer address on the network + * interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * The provisioning state of the network interface IP configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value + */ + public List virtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** + * Set the reference to Virtual Network Taps. + * + * @param virtualNetworkTaps the virtualNetworkTaps value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withVirtualNetworkTaps(List virtualNetworkTaps) { + this.virtualNetworkTaps = virtualNetworkTaps; + return this; + } + + /** + * Get the reference of ApplicationGatewayBackendAddressPool resource. + * + * @return the applicationGatewayBackendAddressPools value + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the reference of ApplicationGatewayBackendAddressPool resource. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the reference of LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the reference of LoadBalancerBackendAddressPool resource. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get a list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value + */ + public List loadBalancerInboundNatRules() { + return this.loadBalancerInboundNatRules; + } + + /** + * Set a list of references of LoadBalancerInboundNatRules. + * + * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerInboundNatRules(List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6'. + * + * @return the privateIPAddressVersion value + */ + public IPVersion privateIPAddressVersion() { + return this.privateIPAddressVersion; + } + + /** + * Set available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6'. + * + * @param privateIPAddressVersion the privateIPAddressVersion value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + this.privateIPAddressVersion = privateIPAddressVersion; + return this; + } + + /** + * Get subnet bound to the IP configuration. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set subnet bound to the IP configuration. + * + * @param subnet the subnet value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets whether this is a primary customer address on the network interface. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary customer address on the network interface. + * + * @param primary the primary value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get public IP address bound to the IP configuration. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set public IP address bound to the IP configuration. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get application security groups in which the IP configuration is included. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups in which the IP configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsImpl.java new file mode 100644 index 0000000000000..39404a3fe5847 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceNetworkInterfaceIPConfiguration; + +class NetworkInterfaceIPConfigurationsImpl extends WrapperImpl implements NetworkInterfaceIPConfigurations { + private final NetworkManager manager; + + NetworkInterfaceIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceNetworkInterfaceIPConfigurationImpl wrapModel(NetworkInterfaceIPConfigurationInner inner) { + return new NetworkInterfaceNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsInner.java new file mode 100644 index 0000000000000..9c840c8e2da43 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceIPConfigurations. + */ +public class NetworkInterfaceIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner get(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceImpl.java new file mode 100644 index 0000000000000..8e23787d27773 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterface; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceDnsSettings; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoint; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfiguration; + +class NetworkInterfaceImpl extends GroupableResourceCoreImpl implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + NetworkInterfaceImpl(String name, NetworkInterfaceInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hostedWorkloads() { + return this.inner().hostedWorkloads(); + } + + @Override + public InterfaceEndpoint interfaceEndpoint() { + InterfaceEndpointInner inner = this.inner().interfaceEndpoint(); + if (inner != null) { + return new InterfaceEndpointImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List tapConfigurations() { + List lst = new ArrayList(); + if (this.inner().tapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().tapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + + @Override + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.inner().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableIPForwarding(Boolean enableIPForwarding) { + this.inner().withEnableIPForwarding(enableIPForwarding); + return this; + } + + @Override + public NetworkInterfaceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public NetworkInterfaceImpl withMacAddress(String macAddress) { + this.inner().withMacAddress(macAddress); + return this; + } + + @Override + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public NetworkInterfaceImpl withPrimary(Boolean primary) { + this.inner().withPrimary(primary); + return this; + } + + @Override + public NetworkInterfaceImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkInterfaceImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkInterfaceImpl withTapConfigurations(List tapConfigurations) { + this.inner().withTapConfigurations(tapConfigurations); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceInner.java new file mode 100644 index 0000000000000..6109d8dcf1e2e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceInner.java @@ -0,0 +1,384 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A network interface in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkInterfaceInner extends Resource { + /** + * The reference of a virtual machine. + */ + @JsonProperty(value = "properties.virtualMachine", access = JsonProperty.Access.WRITE_ONLY) + private SubResource virtualMachine; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * A reference to the interface endpoint to which the network interface is + * linked. + */ + @JsonProperty(value = "properties.interfaceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private InterfaceEndpointInner interfaceEndpoint; + + /** + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * A list of TapConfigurations of the network interface. + */ + @JsonProperty(value = "properties.tapConfigurations") + private List tapConfigurations; + + /** + * The DNS settings in network interface. + */ + @JsonProperty(value = "properties.dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /** + * The MAC address of the network interface. + */ + @JsonProperty(value = "properties.macAddress") + private String macAddress; + + /** + * Gets whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * If the network interface is accelerated networking enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /** + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + + /** + * A list of references to linked BareMetal resources. + */ + @JsonProperty(value = "properties.hostedWorkloads", access = JsonProperty.Access.WRITE_ONLY) + private List hostedWorkloads; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the reference of a virtual machine. + * + * @return the virtualMachine value + */ + public SubResource virtualMachine() { + return this.virtualMachine; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get a reference to the interface endpoint to which the network interface is linked. + * + * @return the interfaceEndpoint value + */ + public InterfaceEndpointInner interfaceEndpoint() { + return this.interfaceEndpoint; + } + + /** + * Get a list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get a list of TapConfigurations of the network interface. + * + * @return the tapConfigurations value + */ + public List tapConfigurations() { + return this.tapConfigurations; + } + + /** + * Set a list of TapConfigurations of the network interface. + * + * @param tapConfigurations the tapConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withTapConfigurations(List tapConfigurations) { + this.tapConfigurations = tapConfigurations; + return this; + } + + /** + * Get the DNS settings in network interface. + * + * @return the dnsSettings value + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the DNS settings in network interface. + * + * @param dnsSettings the dnsSettings value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the MAC address of the network interface. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address of the network interface. + * + * @param macAddress the macAddress value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get gets whether this is a primary network interface on a virtual machine. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary network interface on a virtual machine. + * + * @param primary the primary value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get if the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set if the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + return this; + } + + /** + * Get a list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value + */ + public List hostedWorkloads() { + return this.hostedWorkloads; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network interface resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancerImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancerImpl.java new file mode 100644 index 0000000000000..c14545a89df70 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancerImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatPool; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2019_02_01.OutboundRule; +import com.microsoft.azure.management.network.v2019_02_01.Probe; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerSku; +import java.util.Map; + +class NetworkInterfaceLoadBalancerImpl extends WrapperImpl implements NetworkInterfaceLoadBalancer { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancerImpl(LoadBalancerInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundRules() { + List lst = new ArrayList(); + if (this.inner().outboundRules() != null) { + for (OutboundRuleInner inner : this.inner().outboundRules()) { + lst.add( new OutboundRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersImpl.java new file mode 100644 index 0000000000000..9f6cddb8424ab --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancer; + +class NetworkInterfaceLoadBalancersImpl extends WrapperImpl implements NetworkInterfaceLoadBalancers { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancersImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceLoadBalancers()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceLoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new NetworkInterfaceLoadBalancerImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceLoadBalancersInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceLoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersInner.java new file mode 100644 index 0000000000000..693302e98c37b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceLoadBalancersInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceLoadBalancers. + */ +public class NetworkInterfaceLoadBalancersInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceLoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceLoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceLoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceLoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceLoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..b428919f38e66 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTap; + +class NetworkInterfaceNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements NetworkInterfaceNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String ipConfigurationName; + + NetworkInterfaceNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceIPConfigurationsInner client = this.manager().inner().networkInterfaceIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List virtualNetworkTaps() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkTaps() != null) { + for (VirtualNetworkTapInner inner : this.inner().virtualNetworkTaps()) { + lst.add( new VirtualNetworkTapImpl(inner.name(), inner, manager())); + } + } + return lst; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationImpl.java new file mode 100644 index 0000000000000..be7b122dae150 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationImpl.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTap; + +class NetworkInterfaceTapConfigurationImpl extends CreatableUpdatableImpl implements NetworkInterfaceTapConfiguration, NetworkInterfaceTapConfiguration.Definition, NetworkInterfaceTapConfiguration.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String tapConfigurationName; + + NetworkInterfaceTapConfigurationImpl(String name, NetworkManager manager) { + super(name, new NetworkInterfaceTapConfigurationInner()); + this.manager = manager; + // Set resource name + this.tapConfigurationName = name; + // + } + + NetworkInterfaceTapConfigurationImpl(NetworkInterfaceTapConfigurationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tapConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.tapConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "tapConfigurations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceTapConfigurationsInner client = this.manager().inner().networkInterfaceTapConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.tapConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VirtualNetworkTap virtualNetworkTap() { + VirtualNetworkTapInner inner = this.inner().virtualNetworkTap(); + if (inner != null) { + return new VirtualNetworkTapImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public NetworkInterfaceTapConfigurationImpl withExistingNetworkInterface(String resourceGroupName, String networkInterfaceName) { + this.resourceGroupName = resourceGroupName; + this.networkInterfaceName = networkInterfaceName; + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkInterfaceTapConfigurationImpl withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.inner().withVirtualNetworkTap(virtualNetworkTap); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationInner.java new file mode 100644 index 0000000000000..22b7fec0b26b7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationInner.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Tap configuration in a Network Interface. + */ +@JsonFlatten +public class NetworkInterfaceTapConfigurationInner extends SubResource { + /** + * The reference of the Virtual Network Tap resource. + */ + @JsonProperty(value = "properties.virtualNetworkTap") + private VirtualNetworkTapInner virtualNetworkTap; + + /** + * The provisioning state of the network interface tap configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Sub Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the reference of the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value + */ + public VirtualNetworkTapInner virtualNetworkTap() { + return this.virtualNetworkTap; + } + + /** + * Set the reference of the Virtual Network Tap resource. + * + * @param virtualNetworkTap the virtualNetworkTap value to set + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.virtualNetworkTap = virtualNetworkTap; + return this; + } + + /** + * Get the provisioning state of the network interface tap configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceTapConfigurationInner object itself. + */ + public NetworkInterfaceTapConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get sub Resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsImpl.java new file mode 100644 index 0000000000000..8410eb1bda1fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfiguration; + +class NetworkInterfaceTapConfigurationsImpl extends WrapperImpl implements NetworkInterfaceTapConfigurations { + private final NetworkManager manager; + + NetworkInterfaceTapConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceTapConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceTapConfigurationImpl define(String name) { + return wrapModel(name); + } + + private NetworkInterfaceTapConfigurationImpl wrapModel(NetworkInterfaceTapConfigurationInner inner) { + return new NetworkInterfaceTapConfigurationImpl(inner, manager()); + } + + private NetworkInterfaceTapConfigurationImpl wrapModel(String name) { + return new NetworkInterfaceTapConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceTapConfiguration call(NetworkInterfaceTapConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceTapConfiguration call(NetworkInterfaceTapConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsInner.java new file mode 100644 index 0000000000000..6674d091d1980 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfaceTapConfigurationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceTapConfigurations. + */ +public class NetworkInterfaceTapConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceTapConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceTapConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceTapConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceTapConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceTapConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceTapConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceTapConfigurationInner tapConfigurationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("tapConfigurationName") String tapConfigurationName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceTapConfigurationInner tapConfigurationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner get(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner createOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tapConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter tapConfigurationParameters is required and cannot be null."); + } + Validator.validate(tapConfigurationParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), tapConfigurationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceTapConfigurationInner object if successful. + */ + public NetworkInterfaceTapConfigurationInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters).map(new Func1, NetworkInterfaceTapConfigurationInner>() { + @Override + public NetworkInterfaceTapConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceTapConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (tapConfigurationName == null) { + throw new IllegalArgumentException("Parameter tapConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tapConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter tapConfigurationParameters is required and cannot be null."); + } + Validator.validate(tapConfigurationParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, this.client.subscriptionId(), tapConfigurationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceTapConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Tap configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceTapConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesImpl.java new file mode 100644 index 0000000000000..490c937ca6bf9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterface; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveRouteListResult; +import com.microsoft.azure.management.network.v2019_02_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class NetworkInterfacesImpl extends WrapperImpl implements NetworkInterfaces { + private final NetworkManager manager; + + NetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().networkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceImpl defineNetworkInterface(String name) { + return wrapNetworkInterfaceModel(name); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(String name) { + return new NetworkInterfaceImpl(name, new NetworkInterfaceInner(), this.manager()); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(NetworkInterfaceInner inner) { + return new NetworkInterfaceImpl(inner.name(), inner, manager()); + } + + private VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(NetworkInterfaceIPConfigurationInner inner) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + private Observable getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(String resourceGroupName, String name) { + NetworkInterfacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + private Observable getNetworkInterfaceIPConfigurationInnerUsingNetworkInterfacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(id, "virtualMachineScaleSets"); + String virtualmachineIndex = IdParsingUtils.getValueFromIdByName(id, "virtualMachines"); + String networkInterfaceName = IdParsingUtils.getValueFromIdByName(id, "networkInterfaces"); + String ipConfigurationName = IdParsingUtils.getValueFromIdByName(id, "ipConfigurations"); + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(resourceGroupName, name).map(new Func1 () { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkInterfacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + NetworkInterfacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveRouteListResult call(EffectiveRouteListResultInner inner) { + return new EffectiveRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveNetworkSecurityGroupListResult call(EffectiveNetworkSecurityGroupListResultInner inner) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesInner.java new file mode 100644 index 0000000000000..857ae13ed5887 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkInterfacesInner.java @@ -0,0 +1,2970 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaces. + */ +public class NetworkInterfacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces getEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> getEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces beginGetEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> beginGetEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> listEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces beginListEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> beginListEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces") + Observable> listVirtualMachineScaleSetVMNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + Observable> listVirtualMachineScaleSetNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces getVirtualMachineScaleSetNetworkInterface" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}") + Observable> getVirtualMachineScaleSetNetworkInterface(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurations" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> listVirtualMachineScaleSetIpConfigurations(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces getVirtualMachineScaleSetIpConfiguration" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> getVirtualMachineScaleSetIpConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurationsNext" }) + @GET + Observable> listVirtualMachineScaleSetIpConfigurationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network interface tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network interface tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetEffectiveRouteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetEffectiveRouteTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListEffectiveNetworkSecurityGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListEffectiveNetworkSecurityGroupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetNetworkInterfaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + ServiceResponse> * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetIpConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurationsNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetIpConfigurationsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManagementClientImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManagementClientImpl.java new file mode 100644 index 0000000000000..fdf307052605d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,1370 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the NetworkManagementClientImpl class. + */ +public class NetworkManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private NetworkManagementClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** 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; + + /** + * 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 subscriptionId() { + return this.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 service client itself + */ + public NetworkManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NetworkManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NetworkManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ApplicationGatewaysInner object to access its operations. + */ + private ApplicationGatewaysInner applicationGateways; + + /** + * Gets the ApplicationGatewaysInner object to access its operations. + * @return the ApplicationGatewaysInner object. + */ + public ApplicationGatewaysInner applicationGateways() { + return this.applicationGateways; + } + + /** + * The ApplicationSecurityGroupsInner object to access its operations. + */ + private ApplicationSecurityGroupsInner applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsInner object to access its operations. + * @return the ApplicationSecurityGroupsInner object. + */ + public ApplicationSecurityGroupsInner applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * The AvailableDelegationsInner object to access its operations. + */ + private AvailableDelegationsInner availableDelegations; + + /** + * Gets the AvailableDelegationsInner object to access its operations. + * @return the AvailableDelegationsInner object. + */ + public AvailableDelegationsInner availableDelegations() { + return this.availableDelegations; + } + + /** + * The AvailableResourceGroupDelegationsInner object to access its operations. + */ + private AvailableResourceGroupDelegationsInner availableResourceGroupDelegations; + + /** + * Gets the AvailableResourceGroupDelegationsInner object to access its operations. + * @return the AvailableResourceGroupDelegationsInner object. + */ + public AvailableResourceGroupDelegationsInner availableResourceGroupDelegations() { + return this.availableResourceGroupDelegations; + } + + /** + * The AzureFirewallsInner object to access its operations. + */ + private AzureFirewallsInner azureFirewalls; + + /** + * Gets the AzureFirewallsInner object to access its operations. + * @return the AzureFirewallsInner object. + */ + public AzureFirewallsInner azureFirewalls() { + return this.azureFirewalls; + } + + /** + * The AzureFirewallFqdnTagsInner object to access its operations. + */ + private AzureFirewallFqdnTagsInner azureFirewallFqdnTags; + + /** + * Gets the AzureFirewallFqdnTagsInner object to access its operations. + * @return the AzureFirewallFqdnTagsInner object. + */ + public AzureFirewallFqdnTagsInner azureFirewallFqdnTags() { + return this.azureFirewallFqdnTags; + } + + /** + * The DdosCustomPoliciesInner object to access its operations. + */ + private DdosCustomPoliciesInner ddosCustomPolicies; + + /** + * Gets the DdosCustomPoliciesInner object to access its operations. + * @return the DdosCustomPoliciesInner object. + */ + public DdosCustomPoliciesInner ddosCustomPolicies() { + return this.ddosCustomPolicies; + } + + /** + * The DdosProtectionPlansInner object to access its operations. + */ + private DdosProtectionPlansInner ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansInner object to access its operations. + * @return the DdosProtectionPlansInner object. + */ + public DdosProtectionPlansInner ddosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** + * The AvailableEndpointServicesInner object to access its operations. + */ + private AvailableEndpointServicesInner availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesInner object to access its operations. + * @return the AvailableEndpointServicesInner object. + */ + public AvailableEndpointServicesInner availableEndpointServices() { + return this.availableEndpointServices; + } + + /** + * The ExpressRouteCircuitAuthorizationsInner object to access its operations. + */ + private ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsInner object to access its operations. + * @return the ExpressRouteCircuitAuthorizationsInner object. + */ + public ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** + * The ExpressRouteCircuitPeeringsInner object to access its operations. + */ + private ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsInner object to access its operations. + * @return the ExpressRouteCircuitPeeringsInner object. + */ + public ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** + * The ExpressRouteCircuitConnectionsInner object to access its operations. + */ + private ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsInner object to access its operations. + * @return the ExpressRouteCircuitConnectionsInner object. + */ + public ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** + * The PeerExpressRouteCircuitConnectionsInner object to access its operations. + */ + private PeerExpressRouteCircuitConnectionsInner peerExpressRouteCircuitConnections; + + /** + * Gets the PeerExpressRouteCircuitConnectionsInner object to access its operations. + * @return the PeerExpressRouteCircuitConnectionsInner object. + */ + public PeerExpressRouteCircuitConnectionsInner peerExpressRouteCircuitConnections() { + return this.peerExpressRouteCircuitConnections; + } + + /** + * The ExpressRouteCircuitsInner object to access its operations. + */ + private ExpressRouteCircuitsInner expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsInner object to access its operations. + * @return the ExpressRouteCircuitsInner object. + */ + public ExpressRouteCircuitsInner expressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** + * The ExpressRouteServiceProvidersInner object to access its operations. + */ + private ExpressRouteServiceProvidersInner expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersInner object to access its operations. + * @return the ExpressRouteServiceProvidersInner object. + */ + public ExpressRouteServiceProvidersInner expressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** + * The ExpressRouteCrossConnectionsInner object to access its operations. + */ + private ExpressRouteCrossConnectionsInner expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsInner object to access its operations. + * @return the ExpressRouteCrossConnectionsInner object. + */ + public ExpressRouteCrossConnectionsInner expressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** + * The ExpressRouteCrossConnectionPeeringsInner object to access its operations. + */ + private ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsInner object to access its operations. + * @return the ExpressRouteCrossConnectionPeeringsInner object. + */ + public ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** + * The ExpressRouteGatewaysInner object to access its operations. + */ + private ExpressRouteGatewaysInner expressRouteGateways; + + /** + * Gets the ExpressRouteGatewaysInner object to access its operations. + * @return the ExpressRouteGatewaysInner object. + */ + public ExpressRouteGatewaysInner expressRouteGateways() { + return this.expressRouteGateways; + } + + /** + * The ExpressRouteConnectionsInner object to access its operations. + */ + private ExpressRouteConnectionsInner expressRouteConnections; + + /** + * Gets the ExpressRouteConnectionsInner object to access its operations. + * @return the ExpressRouteConnectionsInner object. + */ + public ExpressRouteConnectionsInner expressRouteConnections() { + return this.expressRouteConnections; + } + + /** + * The ExpressRoutePortsLocationsInner object to access its operations. + */ + private ExpressRoutePortsLocationsInner expressRoutePortsLocations; + + /** + * Gets the ExpressRoutePortsLocationsInner object to access its operations. + * @return the ExpressRoutePortsLocationsInner object. + */ + public ExpressRoutePortsLocationsInner expressRoutePortsLocations() { + return this.expressRoutePortsLocations; + } + + /** + * The ExpressRoutePortsInner object to access its operations. + */ + private ExpressRoutePortsInner expressRoutePorts; + + /** + * Gets the ExpressRoutePortsInner object to access its operations. + * @return the ExpressRoutePortsInner object. + */ + public ExpressRoutePortsInner expressRoutePorts() { + return this.expressRoutePorts; + } + + /** + * The ExpressRouteLinksInner object to access its operations. + */ + private ExpressRouteLinksInner expressRouteLinks; + + /** + * Gets the ExpressRouteLinksInner object to access its operations. + * @return the ExpressRouteLinksInner object. + */ + public ExpressRouteLinksInner expressRouteLinks() { + return this.expressRouteLinks; + } + + /** + * The InterfaceEndpointsInner object to access its operations. + */ + private InterfaceEndpointsInner interfaceEndpoints; + + /** + * Gets the InterfaceEndpointsInner object to access its operations. + * @return the InterfaceEndpointsInner object. + */ + public InterfaceEndpointsInner interfaceEndpoints() { + return this.interfaceEndpoints; + } + + /** + * The LoadBalancersInner object to access its operations. + */ + private LoadBalancersInner loadBalancers; + + /** + * Gets the LoadBalancersInner object to access its operations. + * @return the LoadBalancersInner object. + */ + public LoadBalancersInner loadBalancers() { + return this.loadBalancers; + } + + /** + * The LoadBalancerBackendAddressPoolsInner object to access its operations. + */ + private LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools; + + /** + * Gets the LoadBalancerBackendAddressPoolsInner object to access its operations. + * @return the LoadBalancerBackendAddressPoolsInner object. + */ + public LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * The LoadBalancerFrontendIPConfigurationsInner object to access its operations. + */ + private LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations; + + /** + * Gets the LoadBalancerFrontendIPConfigurationsInner object to access its operations. + * @return the LoadBalancerFrontendIPConfigurationsInner object. + */ + public LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations() { + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * The InboundNatRulesInner object to access its operations. + */ + private InboundNatRulesInner inboundNatRules; + + /** + * Gets the InboundNatRulesInner object to access its operations. + * @return the InboundNatRulesInner object. + */ + public InboundNatRulesInner inboundNatRules() { + return this.inboundNatRules; + } + + /** + * The LoadBalancerLoadBalancingRulesInner object to access its operations. + */ + private LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules; + + /** + * Gets the LoadBalancerLoadBalancingRulesInner object to access its operations. + * @return the LoadBalancerLoadBalancingRulesInner object. + */ + public LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules() { + return this.loadBalancerLoadBalancingRules; + } + + /** + * The LoadBalancerOutboundRulesInner object to access its operations. + */ + private LoadBalancerOutboundRulesInner loadBalancerOutboundRules; + + /** + * Gets the LoadBalancerOutboundRulesInner object to access its operations. + * @return the LoadBalancerOutboundRulesInner object. + */ + public LoadBalancerOutboundRulesInner loadBalancerOutboundRules() { + return this.loadBalancerOutboundRules; + } + + /** + * The LoadBalancerNetworkInterfacesInner object to access its operations. + */ + private LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces; + + /** + * Gets the LoadBalancerNetworkInterfacesInner object to access its operations. + * @return the LoadBalancerNetworkInterfacesInner object. + */ + public LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces() { + return this.loadBalancerNetworkInterfaces; + } + + /** + * The LoadBalancerProbesInner object to access its operations. + */ + private LoadBalancerProbesInner loadBalancerProbes; + + /** + * Gets the LoadBalancerProbesInner object to access its operations. + * @return the LoadBalancerProbesInner object. + */ + public LoadBalancerProbesInner loadBalancerProbes() { + return this.loadBalancerProbes; + } + + /** + * The NatGatewaysInner object to access its operations. + */ + private NatGatewaysInner natGateways; + + /** + * Gets the NatGatewaysInner object to access its operations. + * @return the NatGatewaysInner object. + */ + public NatGatewaysInner natGateways() { + return this.natGateways; + } + + /** + * The NetworkInterfacesInner object to access its operations. + */ + private NetworkInterfacesInner networkInterfaces; + + /** + * Gets the NetworkInterfacesInner object to access its operations. + * @return the NetworkInterfacesInner object. + */ + public NetworkInterfacesInner networkInterfaces() { + return this.networkInterfaces; + } + + /** + * The NetworkInterfaceIPConfigurationsInner object to access its operations. + */ + private NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations; + + /** + * Gets the NetworkInterfaceIPConfigurationsInner object to access its operations. + * @return the NetworkInterfaceIPConfigurationsInner object. + */ + public NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations() { + return this.networkInterfaceIPConfigurations; + } + + /** + * The NetworkInterfaceLoadBalancersInner object to access its operations. + */ + private NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers; + + /** + * Gets the NetworkInterfaceLoadBalancersInner object to access its operations. + * @return the NetworkInterfaceLoadBalancersInner object. + */ + public NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers() { + return this.networkInterfaceLoadBalancers; + } + + /** + * The NetworkInterfaceTapConfigurationsInner object to access its operations. + */ + private NetworkInterfaceTapConfigurationsInner networkInterfaceTapConfigurations; + + /** + * Gets the NetworkInterfaceTapConfigurationsInner object to access its operations. + * @return the NetworkInterfaceTapConfigurationsInner object. + */ + public NetworkInterfaceTapConfigurationsInner networkInterfaceTapConfigurations() { + return this.networkInterfaceTapConfigurations; + } + + /** + * The NetworkProfilesInner object to access its operations. + */ + private NetworkProfilesInner networkProfiles; + + /** + * Gets the NetworkProfilesInner object to access its operations. + * @return the NetworkProfilesInner object. + */ + public NetworkProfilesInner networkProfiles() { + return this.networkProfiles; + } + + /** + * The NetworkSecurityGroupsInner object to access its operations. + */ + private NetworkSecurityGroupsInner networkSecurityGroups; + + /** + * Gets the NetworkSecurityGroupsInner object to access its operations. + * @return the NetworkSecurityGroupsInner object. + */ + public NetworkSecurityGroupsInner networkSecurityGroups() { + return this.networkSecurityGroups; + } + + /** + * The SecurityRulesInner object to access its operations. + */ + private SecurityRulesInner securityRules; + + /** + * Gets the SecurityRulesInner object to access its operations. + * @return the SecurityRulesInner object. + */ + public SecurityRulesInner securityRules() { + return this.securityRules; + } + + /** + * The DefaultSecurityRulesInner object to access its operations. + */ + private DefaultSecurityRulesInner defaultSecurityRules; + + /** + * Gets the DefaultSecurityRulesInner object to access its operations. + * @return the DefaultSecurityRulesInner object. + */ + public DefaultSecurityRulesInner defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * The NetworkWatchersInner object to access its operations. + */ + private NetworkWatchersInner networkWatchers; + + /** + * Gets the NetworkWatchersInner object to access its operations. + * @return the NetworkWatchersInner object. + */ + public NetworkWatchersInner networkWatchers() { + return this.networkWatchers; + } + + /** + * The PacketCapturesInner object to access its operations. + */ + private PacketCapturesInner packetCaptures; + + /** + * Gets the PacketCapturesInner object to access its operations. + * @return the PacketCapturesInner object. + */ + public PacketCapturesInner packetCaptures() { + return this.packetCaptures; + } + + /** + * The ConnectionMonitorsInner object to access its operations. + */ + private ConnectionMonitorsInner connectionMonitors; + + /** + * Gets the ConnectionMonitorsInner object to access its operations. + * @return the ConnectionMonitorsInner object. + */ + public ConnectionMonitorsInner connectionMonitors() { + return this.connectionMonitors; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PublicIPAddressesInner object to access its operations. + */ + private PublicIPAddressesInner publicIPAddresses; + + /** + * Gets the PublicIPAddressesInner object to access its operations. + * @return the PublicIPAddressesInner object. + */ + public PublicIPAddressesInner publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * The PublicIPPrefixesInner object to access its operations. + */ + private PublicIPPrefixesInner publicIPPrefixes; + + /** + * Gets the PublicIPPrefixesInner object to access its operations. + * @return the PublicIPPrefixesInner object. + */ + public PublicIPPrefixesInner publicIPPrefixes() { + return this.publicIPPrefixes; + } + + /** + * The RouteFiltersInner object to access its operations. + */ + private RouteFiltersInner routeFilters; + + /** + * Gets the RouteFiltersInner object to access its operations. + * @return the RouteFiltersInner object. + */ + public RouteFiltersInner routeFilters() { + return this.routeFilters; + } + + /** + * The RouteFilterRulesInner object to access its operations. + */ + private RouteFilterRulesInner routeFilterRules; + + /** + * Gets the RouteFilterRulesInner object to access its operations. + * @return the RouteFilterRulesInner object. + */ + public RouteFilterRulesInner routeFilterRules() { + return this.routeFilterRules; + } + + /** + * The RouteTablesInner object to access its operations. + */ + private RouteTablesInner routeTables; + + /** + * Gets the RouteTablesInner object to access its operations. + * @return the RouteTablesInner object. + */ + public RouteTablesInner routeTables() { + return this.routeTables; + } + + /** + * The RoutesInner object to access its operations. + */ + private RoutesInner routes; + + /** + * Gets the RoutesInner object to access its operations. + * @return the RoutesInner object. + */ + public RoutesInner routes() { + return this.routes; + } + + /** + * The BgpServiceCommunitiesInner object to access its operations. + */ + private BgpServiceCommunitiesInner bgpServiceCommunities; + + /** + * Gets the BgpServiceCommunitiesInner object to access its operations. + * @return the BgpServiceCommunitiesInner object. + */ + public BgpServiceCommunitiesInner bgpServiceCommunities() { + return this.bgpServiceCommunities; + } + + /** + * The ServiceEndpointPoliciesInner object to access its operations. + */ + private ServiceEndpointPoliciesInner serviceEndpointPolicies; + + /** + * Gets the ServiceEndpointPoliciesInner object to access its operations. + * @return the ServiceEndpointPoliciesInner object. + */ + public ServiceEndpointPoliciesInner serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * The ServiceEndpointPolicyDefinitionsInner object to access its operations. + */ + private ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions; + + /** + * Gets the ServiceEndpointPolicyDefinitionsInner object to access its operations. + * @return the ServiceEndpointPolicyDefinitionsInner object. + */ + public ServiceEndpointPolicyDefinitionsInner serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The VirtualNetworksInner object to access its operations. + */ + private VirtualNetworksInner virtualNetworks; + + /** + * Gets the VirtualNetworksInner object to access its operations. + * @return the VirtualNetworksInner object. + */ + public VirtualNetworksInner virtualNetworks() { + return this.virtualNetworks; + } + + /** + * The SubnetsInner object to access its operations. + */ + private SubnetsInner subnets; + + /** + * Gets the SubnetsInner object to access its operations. + * @return the SubnetsInner object. + */ + public SubnetsInner subnets() { + return this.subnets; + } + + /** + * The VirtualNetworkPeeringsInner object to access its operations. + */ + private VirtualNetworkPeeringsInner virtualNetworkPeerings; + + /** + * Gets the VirtualNetworkPeeringsInner object to access its operations. + * @return the VirtualNetworkPeeringsInner object. + */ + public VirtualNetworkPeeringsInner virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * The VirtualNetworkGatewaysInner object to access its operations. + */ + private VirtualNetworkGatewaysInner virtualNetworkGateways; + + /** + * Gets the VirtualNetworkGatewaysInner object to access its operations. + * @return the VirtualNetworkGatewaysInner object. + */ + public VirtualNetworkGatewaysInner virtualNetworkGateways() { + return this.virtualNetworkGateways; + } + + /** + * The VirtualNetworkGatewayConnectionsInner object to access its operations. + */ + private VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections; + + /** + * Gets the VirtualNetworkGatewayConnectionsInner object to access its operations. + * @return the VirtualNetworkGatewayConnectionsInner object. + */ + public VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections() { + return this.virtualNetworkGatewayConnections; + } + + /** + * The LocalNetworkGatewaysInner object to access its operations. + */ + private LocalNetworkGatewaysInner localNetworkGateways; + + /** + * Gets the LocalNetworkGatewaysInner object to access its operations. + * @return the LocalNetworkGatewaysInner object. + */ + public LocalNetworkGatewaysInner localNetworkGateways() { + return this.localNetworkGateways; + } + + /** + * The VirtualNetworkTapsInner object to access its operations. + */ + private VirtualNetworkTapsInner virtualNetworkTaps; + + /** + * Gets the VirtualNetworkTapsInner object to access its operations. + * @return the VirtualNetworkTapsInner object. + */ + public VirtualNetworkTapsInner virtualNetworkTaps() { + return this.virtualNetworkTaps; + } + + /** + * The VirtualWansInner object to access its operations. + */ + private VirtualWansInner virtualWans; + + /** + * Gets the VirtualWansInner object to access its operations. + * @return the VirtualWansInner object. + */ + public VirtualWansInner virtualWans() { + return this.virtualWans; + } + + /** + * The VpnSitesInner object to access its operations. + */ + private VpnSitesInner vpnSites; + + /** + * Gets the VpnSitesInner object to access its operations. + * @return the VpnSitesInner object. + */ + public VpnSitesInner vpnSites() { + return this.vpnSites; + } + + /** + * The VpnSitesConfigurationsInner object to access its operations. + */ + private VpnSitesConfigurationsInner vpnSitesConfigurations; + + /** + * Gets the VpnSitesConfigurationsInner object to access its operations. + * @return the VpnSitesConfigurationsInner object. + */ + public VpnSitesConfigurationsInner vpnSitesConfigurations() { + return this.vpnSitesConfigurations; + } + + /** + * The VirtualHubsInner object to access its operations. + */ + private VirtualHubsInner virtualHubs; + + /** + * Gets the VirtualHubsInner object to access its operations. + * @return the VirtualHubsInner object. + */ + public VirtualHubsInner virtualHubs() { + return this.virtualHubs; + } + + /** + * The HubVirtualNetworkConnectionsInner object to access its operations. + */ + private HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsInner object to access its operations. + * @return the HubVirtualNetworkConnectionsInner object. + */ + public HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * The VpnGatewaysInner object to access its operations. + */ + private VpnGatewaysInner vpnGateways; + + /** + * Gets the VpnGatewaysInner object to access its operations. + * @return the VpnGatewaysInner object. + */ + public VpnGatewaysInner vpnGateways() { + return this.vpnGateways; + } + + /** + * The VpnConnectionsInner object to access its operations. + */ + private VpnConnectionsInner vpnConnections; + + /** + * Gets the VpnConnectionsInner object to access its operations. + * @return the VpnConnectionsInner object. + */ + public VpnConnectionsInner vpnConnections() { + return this.vpnConnections; + } + + /** + * The P2sVpnServerConfigurationsInner object to access its operations. + */ + private P2sVpnServerConfigurationsInner p2sVpnServerConfigurations; + + /** + * Gets the P2sVpnServerConfigurationsInner object to access its operations. + * @return the P2sVpnServerConfigurationsInner object. + */ + public P2sVpnServerConfigurationsInner p2sVpnServerConfigurations() { + return this.p2sVpnServerConfigurations; + } + + /** + * The P2sVpnGatewaysInner object to access its operations. + */ + private P2sVpnGatewaysInner p2sVpnGateways; + + /** + * Gets the P2sVpnGatewaysInner object to access its operations. + * @return the P2sVpnGatewaysInner object. + */ + public P2sVpnGatewaysInner p2sVpnGateways() { + return this.p2sVpnGateways; + } + + /** + * The WebApplicationFirewallPoliciesInner object to access its operations. + */ + private WebApplicationFirewallPoliciesInner webApplicationFirewallPolicies; + + /** + * Gets the WebApplicationFirewallPoliciesInner object to access its operations. + * @return the WebApplicationFirewallPoliciesInner object. + */ + public WebApplicationFirewallPoliciesInner webApplicationFirewallPolicies() { + return this.webApplicationFirewallPolicies; + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NetworkManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.applicationGateways = new ApplicationGatewaysInner(restClient().retrofit(), this); + this.applicationSecurityGroups = new ApplicationSecurityGroupsInner(restClient().retrofit(), this); + this.availableDelegations = new AvailableDelegationsInner(restClient().retrofit(), this); + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsInner(restClient().retrofit(), this); + this.azureFirewalls = new AzureFirewallsInner(restClient().retrofit(), this); + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsInner(restClient().retrofit(), this); + this.ddosCustomPolicies = new DdosCustomPoliciesInner(restClient().retrofit(), this); + this.ddosProtectionPlans = new DdosProtectionPlansInner(restClient().retrofit(), this); + this.availableEndpointServices = new AvailableEndpointServicesInner(restClient().retrofit(), this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsInner(restClient().retrofit(), this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsInner(restClient().retrofit(), this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsInner(restClient().retrofit(), this); + this.peerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsInner(restClient().retrofit(), this); + this.expressRouteCircuits = new ExpressRouteCircuitsInner(restClient().retrofit(), this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersInner(restClient().retrofit(), this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsInner(restClient().retrofit(), this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsInner(restClient().retrofit(), this); + this.expressRouteGateways = new ExpressRouteGatewaysInner(restClient().retrofit(), this); + this.expressRouteConnections = new ExpressRouteConnectionsInner(restClient().retrofit(), this); + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsInner(restClient().retrofit(), this); + this.expressRoutePorts = new ExpressRoutePortsInner(restClient().retrofit(), this); + this.expressRouteLinks = new ExpressRouteLinksInner(restClient().retrofit(), this); + this.interfaceEndpoints = new InterfaceEndpointsInner(restClient().retrofit(), this); + this.loadBalancers = new LoadBalancersInner(restClient().retrofit(), this); + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsInner(restClient().retrofit(), this); + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsInner(restClient().retrofit(), this); + this.inboundNatRules = new InboundNatRulesInner(restClient().retrofit(), this); + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesInner(restClient().retrofit(), this); + this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesInner(restClient().retrofit(), this); + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesInner(restClient().retrofit(), this); + this.loadBalancerProbes = new LoadBalancerProbesInner(restClient().retrofit(), this); + this.natGateways = new NatGatewaysInner(restClient().retrofit(), this); + this.networkInterfaces = new NetworkInterfacesInner(restClient().retrofit(), this); + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsInner(restClient().retrofit(), this); + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersInner(restClient().retrofit(), this); + this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsInner(restClient().retrofit(), this); + this.networkProfiles = new NetworkProfilesInner(restClient().retrofit(), this); + this.networkSecurityGroups = new NetworkSecurityGroupsInner(restClient().retrofit(), this); + this.securityRules = new SecurityRulesInner(restClient().retrofit(), this); + this.defaultSecurityRules = new DefaultSecurityRulesInner(restClient().retrofit(), this); + this.networkWatchers = new NetworkWatchersInner(restClient().retrofit(), this); + this.packetCaptures = new PacketCapturesInner(restClient().retrofit(), this); + this.connectionMonitors = new ConnectionMonitorsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.publicIPAddresses = new PublicIPAddressesInner(restClient().retrofit(), this); + this.publicIPPrefixes = new PublicIPPrefixesInner(restClient().retrofit(), this); + this.routeFilters = new RouteFiltersInner(restClient().retrofit(), this); + this.routeFilterRules = new RouteFilterRulesInner(restClient().retrofit(), this); + this.routeTables = new RouteTablesInner(restClient().retrofit(), this); + this.routes = new RoutesInner(restClient().retrofit(), this); + this.bgpServiceCommunities = new BgpServiceCommunitiesInner(restClient().retrofit(), this); + this.serviceEndpointPolicies = new ServiceEndpointPoliciesInner(restClient().retrofit(), this); + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.virtualNetworks = new VirtualNetworksInner(restClient().retrofit(), this); + this.subnets = new SubnetsInner(restClient().retrofit(), this); + this.virtualNetworkPeerings = new VirtualNetworkPeeringsInner(restClient().retrofit(), this); + this.virtualNetworkGateways = new VirtualNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsInner(restClient().retrofit(), this); + this.localNetworkGateways = new LocalNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualNetworkTaps = new VirtualNetworkTapsInner(restClient().retrofit(), this); + this.virtualWans = new VirtualWansInner(restClient().retrofit(), this); + this.vpnSites = new VpnSitesInner(restClient().retrofit(), this); + this.vpnSitesConfigurations = new VpnSitesConfigurationsInner(restClient().retrofit(), this); + this.virtualHubs = new VirtualHubsInner(restClient().retrofit(), this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsInner(restClient().retrofit(), this); + this.vpnGateways = new VpnGatewaysInner(restClient().retrofit(), this); + this.vpnConnections = new VpnConnectionsInner(restClient().retrofit(), this); + this.p2sVpnServerConfigurations = new P2sVpnServerConfigurationsInner(restClient().retrofit(), this); + this.p2sVpnGateways = new P2sVpnGatewaysInner(restClient().retrofit(), this); + this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "NetworkManagementClient", "2019-02-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(NetworkManagementClientService.class); + } + + /** + * The interface defining all the services for NetworkManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkManagementClient checkDnsNameAvailability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + Observable> checkDnsNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("domainNameLabel") String domainNameLabel, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkManagementClient supportedSecurityProviders" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders") + Observable> supportedSecurityProviders(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DnsNameAvailabilityResultInner object if successful. + */ + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkDnsNameAvailabilityAsync(String location, String domainNameLabel, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel), serviceCallback); + } + + /** + * 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 + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (domainNameLabel == null) { + throw new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.checkDnsNameAvailability(location, this.subscriptionId(), domainNameLabel, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWanSecurityProvidersInner object if successful. + */ + public VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, String virtualWANName) { + return supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualWanSecurityProvidersInner object + */ + public Observable supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName) { + return supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWanSecurityProvidersInner>() { + @Override + public VirtualWanSecurityProvidersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualWanSecurityProvidersInner object + */ + public Observable> supportedSecurityProvidersWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.supportedSecurityProviders(this.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedSecurityProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedSecurityProvidersDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManager.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManager.java new file mode 100644 index 0000000000000..b52e33cb62dec --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkManager.java @@ -0,0 +1,939 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2019_02_01.AvailableDelegations; +import com.microsoft.azure.management.network.v2019_02_01.AvailableResourceGroupDelegations; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2019_02_01.AzureFirewallFqdnTags; +import com.microsoft.azure.management.network.v2019_02_01.DdosCustomPolicies; +import com.microsoft.azure.management.network.v2019_02_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2019_02_01.AvailableEndpointServices; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitAuthorizations; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeerings; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitConnections; +import com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnections; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCrossConnectionPeerings; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteGateways; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteConnections; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePortsLocations; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRoutePorts; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteLinks; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoints; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancers; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerBackendAddressPools; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerFrontendIPConfigurations; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRules; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerLoadBalancingRules; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRules; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerNetworkInterfaces; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerProbes; +import com.microsoft.azure.management.network.v2019_02_01.NatGateways; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaces; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceIPConfigurations; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceLoadBalancers; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfigurations; +import com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRules; +import com.microsoft.azure.management.network.v2019_02_01.DefaultSecurityRules; +import com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptures; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionMonitors; +import com.microsoft.azure.management.network.v2019_02_01.Operations; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilters; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules; +import com.microsoft.azure.management.network.v2019_02_01.RouteTables; +import com.microsoft.azure.management.network.v2019_02_01.Routes; +import com.microsoft.azure.management.network.v2019_02_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions; +import com.microsoft.azure.management.network.v2019_02_01.Usages; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2019_02_01.Subnets; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps; +import com.microsoft.azure.management.network.v2019_02_01.VirtualWans; +import com.microsoft.azure.management.network.v2019_02_01.VpnSites; +import com.microsoft.azure.management.network.v2019_02_01.VpnSitesConfigurations; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubs; +import com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnections; +import com.microsoft.azure.management.network.v2019_02_01.VpnGateways; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnections; +import com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations; +import com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private ApplicationGateways applicationGateways; + private ApplicationSecurityGroups applicationSecurityGroups; + private AvailableDelegations availableDelegations; + private AvailableResourceGroupDelegations availableResourceGroupDelegations; + private AzureFirewalls azureFirewalls; + private AzureFirewallFqdnTags azureFirewallFqdnTags; + private DdosCustomPolicies ddosCustomPolicies; + private DdosProtectionPlans ddosProtectionPlans; + 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 ExpressRouteGateways expressRouteGateways; + private ExpressRouteConnections expressRouteConnections; + private ExpressRoutePortsLocations expressRoutePortsLocations; + private ExpressRoutePorts expressRoutePorts; + private ExpressRouteLinks expressRouteLinks; + private InterfaceEndpoints interfaceEndpoints; + 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 NetworkInterfaces networkInterfaces; + private NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations; + private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers; + private NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations; + private NetworkProfiles networkProfiles; + private NetworkSecurityGroups networkSecurityGroups; + private SecurityRules securityRules; + private DefaultSecurityRules defaultSecurityRules; + private NetworkWatchers networkWatchers; + private PacketCaptures packetCaptures; + private ConnectionMonitors connectionMonitors; + private Operations operations; + private PublicIPAddresses publicIPAddresses; + private PublicIPPrefixes publicIPPrefixes; + private RouteFilters routeFilters; + private RouteFilterRules routeFilterRules; + private RouteTables routeTables; + private Routes routes; + private BgpServiceCommunities bgpServiceCommunities; + private ServiceEndpointPolicies serviceEndpointPolicies; + private ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions; + private Usages usages; + private VirtualNetworks virtualNetworks; + private Subnets subnets; + private VirtualNetworkPeerings virtualNetworkPeerings; + private VirtualNetworkGateways virtualNetworkGateways; + private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections; + private LocalNetworkGateways localNetworkGateways; + private VirtualNetworkTaps virtualNetworkTaps; + private VirtualWans virtualWans; + private VpnSites vpnSites; + private VpnSitesConfigurations vpnSitesConfigurations; + private VirtualHubs virtualHubs; + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + private VpnGateways vpnGateways; + private VpnConnections vpnConnections; + private P2sVpnServerConfigurations p2sVpnServerConfigurations; + private P2sVpnGateways p2sVpnGateways; + private WebApplicationFirewallPolicies webApplicationFirewallPolicies; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ApplicationGateways. + */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(this); + } + return this.applicationGateways; + } + + /** + * @return Entry point to manage ApplicationSecurityGroups. + */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = new ApplicationSecurityGroupsImpl(this); + } + return this.applicationSecurityGroups; + } + + /** + * @return Entry point to manage AvailableDelegations. + */ + public AvailableDelegations availableDelegations() { + if (this.availableDelegations == null) { + this.availableDelegations = new AvailableDelegationsImpl(this); + } + return this.availableDelegations; + } + + /** + * @return Entry point to manage AvailableResourceGroupDelegations. + */ + public AvailableResourceGroupDelegations availableResourceGroupDelegations() { + if (this.availableResourceGroupDelegations == null) { + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsImpl(this); + } + return this.availableResourceGroupDelegations; + } + + /** + * @return Entry point to manage AzureFirewalls. + */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(this); + } + return this.azureFirewalls; + } + + /** + * @return Entry point to manage AzureFirewallFqdnTags. + */ + public AzureFirewallFqdnTags azureFirewallFqdnTags() { + if (this.azureFirewallFqdnTags == null) { + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(this); + } + return this.azureFirewallFqdnTags; + } + + /** + * @return Entry point to manage DdosCustomPolicies. + */ + public DdosCustomPolicies ddosCustomPolicies() { + if (this.ddosCustomPolicies == null) { + this.ddosCustomPolicies = new DdosCustomPoliciesImpl(this); + } + return this.ddosCustomPolicies; + } + + /** + * @return Entry point to manage DdosProtectionPlans. + */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(this); + } + return this.ddosProtectionPlans; + } + + /** + * @return Entry point to manage AvailableEndpointServices. + */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = new AvailableEndpointServicesImpl(this); + } + return this.availableEndpointServices; + } + + /** + * @return Entry point to manage ExpressRouteCircuitAuthorizations. + */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsImpl(this); + } + return this.expressRouteCircuitAuthorizations; + } + + /** + * @return Entry point to manage ExpressRouteCircuitPeerings. + */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsImpl(this); + } + return this.expressRouteCircuitPeerings; + } + + /** + * @return Entry point to manage ExpressRouteCircuitConnections. + */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsImpl(this); + } + return this.expressRouteCircuitConnections; + } + + /** + * @return Entry point to manage PeerExpressRouteCircuitConnections. + */ + public PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections() { + if (this.peerExpressRouteCircuitConnections == null) { + this.peerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsImpl(this); + } + return this.peerExpressRouteCircuitConnections; + } + + /** + * @return Entry point to manage ExpressRouteCircuits. + */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(this); + } + return this.expressRouteCircuits; + } + + /** + * @return Entry point to manage ExpressRouteServiceProviders. + */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersImpl(this); + } + return this.expressRouteServiceProviders; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnections. + */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsImpl(this); + } + return this.expressRouteCrossConnections; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnectionPeerings. + */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsImpl(this); + } + return this.expressRouteCrossConnectionPeerings; + } + + /** + * @return Entry point to manage ExpressRouteGateways. + */ + public ExpressRouteGateways expressRouteGateways() { + if (this.expressRouteGateways == null) { + this.expressRouteGateways = new ExpressRouteGatewaysImpl(this); + } + return this.expressRouteGateways; + } + + /** + * @return Entry point to manage ExpressRouteConnections. + */ + public ExpressRouteConnections expressRouteConnections() { + if (this.expressRouteConnections == null) { + this.expressRouteConnections = new ExpressRouteConnectionsImpl(this); + } + return this.expressRouteConnections; + } + + /** + * @return Entry point to manage ExpressRoutePortsLocations. + */ + public ExpressRoutePortsLocations expressRoutePortsLocations() { + if (this.expressRoutePortsLocations == null) { + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsImpl(this); + } + return this.expressRoutePortsLocations; + } + + /** + * @return Entry point to manage ExpressRoutePorts. + */ + public ExpressRoutePorts expressRoutePorts() { + if (this.expressRoutePorts == null) { + this.expressRoutePorts = new ExpressRoutePortsImpl(this); + } + return this.expressRoutePorts; + } + + /** + * @return Entry point to manage ExpressRouteLinks. + */ + public ExpressRouteLinks expressRouteLinks() { + if (this.expressRouteLinks == null) { + this.expressRouteLinks = new ExpressRouteLinksImpl(this); + } + return this.expressRouteLinks; + } + + /** + * @return Entry point to manage InterfaceEndpoints. + */ + public InterfaceEndpoints interfaceEndpoints() { + if (this.interfaceEndpoints == null) { + this.interfaceEndpoints = new InterfaceEndpointsImpl(this); + } + return this.interfaceEndpoints; + } + + /** + * @return Entry point to manage LoadBalancers. + */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(this); + } + return this.loadBalancers; + } + + /** + * @return Entry point to manage LoadBalancerBackendAddressPools. + */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsImpl(this); + } + return this.loadBalancerBackendAddressPools; + } + + /** + * @return Entry point to manage LoadBalancerFrontendIPConfigurations. + */ + public LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations() { + if (this.loadBalancerFrontendIPConfigurations == null) { + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsImpl(this); + } + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * @return Entry point to manage InboundNatRules. + */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(this); + } + return this.inboundNatRules; + } + + /** + * @return Entry point to manage LoadBalancerLoadBalancingRules. + */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesImpl(this); + } + return this.loadBalancerLoadBalancingRules; + } + + /** + * @return Entry point to manage LoadBalancerOutboundRules. + */ + public LoadBalancerOutboundRules loadBalancerOutboundRules() { + if (this.loadBalancerOutboundRules == null) { + this.loadBalancerOutboundRules = new LoadBalancerOutboundRulesImpl(this); + } + return this.loadBalancerOutboundRules; + } + + /** + * @return Entry point to manage LoadBalancerNetworkInterfaces. + */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesImpl(this); + } + return this.loadBalancerNetworkInterfaces; + } + + /** + * @return Entry point to manage LoadBalancerProbes. + */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(this); + } + return this.loadBalancerProbes; + } + + /** + * @return Entry point to manage NatGateways. + */ + public NatGateways natGateways() { + if (this.natGateways == null) { + this.natGateways = new NatGatewaysImpl(this); + } + return this.natGateways; + } + + /** + * @return Entry point to manage NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(this); + } + return this.networkInterfaces; + } + + /** + * @return Entry point to manage NetworkInterfaceIPConfigurations. + */ + public NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations() { + if (this.networkInterfaceIPConfigurations == null) { + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsImpl(this); + } + return this.networkInterfaceIPConfigurations; + } + + /** + * @return Entry point to manage NetworkInterfaceLoadBalancers. + */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersImpl(this); + } + return this.networkInterfaceLoadBalancers; + } + + /** + * @return Entry point to manage NetworkInterfaceTapConfigurations. + */ + public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() { + if (this.networkInterfaceTapConfigurations == null) { + this.networkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsImpl(this); + } + return this.networkInterfaceTapConfigurations; + } + + /** + * @return Entry point to manage NetworkProfiles. + */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(this); + } + return this.networkProfiles; + } + + /** + * @return Entry point to manage NetworkSecurityGroups. + */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(this); + } + return this.networkSecurityGroups; + } + + /** + * @return Entry point to manage SecurityRules. + */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(this); + } + return this.securityRules; + } + + /** + * @return Entry point to manage DefaultSecurityRules. + */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(this); + } + return this.defaultSecurityRules; + } + + /** + * @return Entry point to manage NetworkWatchers. + */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(this); + } + return this.networkWatchers; + } + + /** + * @return Entry point to manage PacketCaptures. + */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(this); + } + return this.packetCaptures; + } + + /** + * @return Entry point to manage ConnectionMonitors. + */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(this); + } + return this.connectionMonitors; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PublicIPAddresses. + */ + public PublicIPAddresses publicIPAddresses() { + if (this.publicIPAddresses == null) { + this.publicIPAddresses = new PublicIPAddressesImpl(this); + } + return this.publicIPAddresses; + } + + /** + * @return Entry point to manage PublicIPPrefixes. + */ + public PublicIPPrefixes publicIPPrefixes() { + if (this.publicIPPrefixes == null) { + this.publicIPPrefixes = new PublicIPPrefixesImpl(this); + } + return this.publicIPPrefixes; + } + + /** + * @return Entry point to manage RouteFilters. + */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(this); + } + return this.routeFilters; + } + + /** + * @return Entry point to manage RouteFilterRules. + */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(this); + } + return this.routeFilterRules; + } + + /** + * @return Entry point to manage RouteTables. + */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(this); + } + return this.routeTables; + } + + /** + * @return Entry point to manage Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(this); + } + return this.routes; + } + + /** + * @return Entry point to manage BgpServiceCommunities. + */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(this); + } + return this.bgpServiceCommunities; + } + + /** + * @return Entry point to manage ServiceEndpointPolicies. + */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies = new ServiceEndpointPoliciesImpl(this); + } + return this.serviceEndpointPolicies; + } + + /** + * @return Entry point to manage ServiceEndpointPolicyDefinitions. + */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsImpl(this); + } + return this.serviceEndpointPolicyDefinitions; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage VirtualNetworks. + */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(this); + } + return this.virtualNetworks; + } + + /** + * @return Entry point to manage Subnets. + */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(this); + } + return this.subnets; + } + + /** + * @return Entry point to manage VirtualNetworkPeerings. + */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = new VirtualNetworkPeeringsImpl(this); + } + return this.virtualNetworkPeerings; + } + + /** + * @return Entry point to manage VirtualNetworkGateways. + */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = new VirtualNetworkGatewaysImpl(this); + } + return this.virtualNetworkGateways; + } + + /** + * @return Entry point to manage VirtualNetworkGatewayConnections. + */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsImpl(this); + } + return this.virtualNetworkGatewayConnections; + } + + /** + * @return Entry point to manage LocalNetworkGateways. + */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(this); + } + return this.localNetworkGateways; + } + + /** + * @return Entry point to manage VirtualNetworkTaps. + */ + public VirtualNetworkTaps virtualNetworkTaps() { + if (this.virtualNetworkTaps == null) { + this.virtualNetworkTaps = new VirtualNetworkTapsImpl(this); + } + return this.virtualNetworkTaps; + } + + /** + * @return Entry point to manage VirtualWans. + */ + public VirtualWans virtualWans() { + if (this.virtualWans == null) { + this.virtualWans = new VirtualWansImpl(this); + } + return this.virtualWans; + } + + /** + * @return Entry point to manage VpnSites. + */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(this); + } + return this.vpnSites; + } + + /** + * @return Entry point to manage VpnSitesConfigurations. + */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = new VpnSitesConfigurationsImpl(this); + } + return this.vpnSitesConfigurations; + } + + /** + * @return Entry point to manage VirtualHubs. + */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(this); + } + return this.virtualHubs; + } + + /** + * @return Entry point to manage HubVirtualNetworkConnections. + */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsImpl(this); + } + return this.hubVirtualNetworkConnections; + } + + /** + * @return Entry point to manage VpnGateways. + */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(this); + } + return this.vpnGateways; + } + + /** + * @return Entry point to manage VpnConnections. + */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(this); + } + return this.vpnConnections; + } + + /** + * @return Entry point to manage P2sVpnServerConfigurations. + */ + public P2sVpnServerConfigurations p2sVpnServerConfigurations() { + if (this.p2sVpnServerConfigurations == null) { + this.p2sVpnServerConfigurations = new P2sVpnServerConfigurationsImpl(this); + } + return this.p2sVpnServerConfigurations; + } + + /** + * @return Entry point to manage P2sVpnGateways. + */ + public P2sVpnGateways p2sVpnGateways() { + if (this.p2sVpnGateways == null) { + this.p2sVpnGateways = new P2sVpnGatewaysImpl(this); + } + return this.p2sVpnGateways; + } + + /** + * @return Entry point to manage WebApplicationFirewallPolicies. + */ + public WebApplicationFirewallPolicies webApplicationFirewallPolicies() { + if (this.webApplicationFirewallPolicies == null) { + this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesImpl(this); + } + return this.webApplicationFirewallPolicies; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NetworkManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..5f3b0640f29c1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkProfile; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ContainerNetworkInterface; +import com.microsoft.azure.management.network.v2019_02_01.ContainerNetworkInterfaceConfiguration; + +class NetworkProfileImpl extends GroupableResourceCoreImpl implements NetworkProfile, NetworkProfile.Definition, NetworkProfile.Update { + NetworkProfileImpl(String name, NetworkProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkProfilesInner client = this.manager().inner().networkProfiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containerNetworkInterfaceConfigurations() { + return this.inner().containerNetworkInterfaceConfigurations(); + } + + @Override + public List containerNetworkInterfaces() { + return this.inner().containerNetworkInterfaces(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public NetworkProfileImpl withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations) { + this.inner().withContainerNetworkInterfaceConfigurations(containerNetworkInterfaceConfigurations); + return this; + } + + @Override + public NetworkProfileImpl withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.inner().withContainerNetworkInterfaces(containerNetworkInterfaces); + return this; + } + + @Override + public NetworkProfileImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileInner.java new file mode 100644 index 0000000000000..9fdbd04465d59 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfileInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ContainerNetworkInterface; +import com.microsoft.azure.management.network.v2019_02_01.ContainerNetworkInterfaceConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network profile resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkProfileInner extends Resource { + /** + * List of child container network interfaces. + */ + @JsonProperty(value = "properties.containerNetworkInterfaces") + private List containerNetworkInterfaces; + + /** + * List of chid container network interface configurations. + */ + @JsonProperty(value = "properties.containerNetworkInterfaceConfigurations") + private List containerNetworkInterfaceConfigurations; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of child container network interfaces. + * + * @return the containerNetworkInterfaces value + */ + public List containerNetworkInterfaces() { + return this.containerNetworkInterfaces; + } + + /** + * Set list of child container network interfaces. + * + * @param containerNetworkInterfaces the containerNetworkInterfaces value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withContainerNetworkInterfaces(List containerNetworkInterfaces) { + this.containerNetworkInterfaces = containerNetworkInterfaces; + return this; + } + + /** + * Get list of chid container network interface configurations. + * + * @return the containerNetworkInterfaceConfigurations value + */ + public List containerNetworkInterfaceConfigurations() { + return this.containerNetworkInterfaceConfigurations; + } + + /** + * Set list of chid container network interface configurations. + * + * @param containerNetworkInterfaceConfigurations the containerNetworkInterfaceConfigurations value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withContainerNetworkInterfaceConfigurations(List containerNetworkInterfaceConfigurations) { + this.containerNetworkInterfaceConfigurations = containerNetworkInterfaceConfigurations; + return this; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesImpl.java new file mode 100644 index 0000000000000..758cac65be9a8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles; +import com.microsoft.azure.management.network.v2019_02_01.NetworkProfile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkProfilesImpl extends GroupableResourcesCoreImpl implements NetworkProfiles { + protected NetworkProfilesImpl(NetworkManager manager) { + super(manager.inner().networkProfiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkProfile call(NetworkProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkProfilesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkProfile call(NetworkProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkProfileImpl wrapModel(NetworkProfileInner inner) { + return new NetworkProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkProfileImpl wrapModel(String name) { + return new NetworkProfileImpl(name, new NetworkProfileInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesInner.java new file mode 100644 index 0000000000000..ced74a6001ffe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkProfilesInner.java @@ -0,0 +1,994 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkProfiles. + */ +public class NetworkProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkProfilesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkProfilesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkProfiles to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Body NetworkProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkProfileName") String networkProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkProfiles listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkProfileName) { + deleteWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().last().body(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkProfileName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkProfileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkProfileName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkProfileName, expand).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkProfileName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner createOrUpdate(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkProfileName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName).toBlocking().last().body(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName), serviceCallback); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkProfileName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkProfileInner object if successful. + */ + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags).toBlocking().last().body(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkProfileName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags), serviceCallback); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkProfileName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkProfileName, tags).map(new Func1, NetworkProfileInner>() { + @Override + public NetworkProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkProfileName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkProfileName == null) { + throw new IllegalArgumentException("Parameter networkProfileName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkProfileName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the network profiles in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the network profiles in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkProfileInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkProfileInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network profiles in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..18e9fbbff3a40 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroup; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterface; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class NetworkSecurityGroupImpl extends GroupableResourceCoreImpl implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + NetworkSecurityGroupImpl(String name, NetworkSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List defaultSecurityRules() { + List lst = new ArrayList(); + if (this.inner().defaultSecurityRules() != null) { + for (SecurityRuleInner inner : this.inner().defaultSecurityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List securityRules() { + List lst = new ArrayList(); + if (this.inner().securityRules() != null) { + for (SecurityRuleInner inner : this.inner().securityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public NetworkSecurityGroupImpl withDefaultSecurityRules(List defaultSecurityRules) { + this.inner().withDefaultSecurityRules(defaultSecurityRules); + return this; + } + + @Override + public NetworkSecurityGroupImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.inner().withSecurityRules(securityRules); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupInner.java new file mode 100644 index 0000000000000..511937470bcaa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupInner.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * NetworkSecurityGroup resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkSecurityGroupInner extends Resource { + /** + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "properties.securityRules") + private List securityRules; + + /** + * The default security rules of network security group. + */ + @JsonProperty(value = "properties.defaultSecurityRules") + private List defaultSecurityRules; + + /** + * A collection of references to network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of security rules of the network security group. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set a collection of security rules of the network security group. + * + * @param securityRules the securityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Get the default security rules of network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the default security rules of network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get a collection of references to network interfaces. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the network security group resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network security group resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java new file mode 100644 index 0000000000000..cda11f77fc68c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleDirection; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; + +class NetworkSecurityGroupSecurityRuleImpl extends CreatableUpdatableImpl implements NetworkSecurityGroupSecurityRule, NetworkSecurityGroupSecurityRule.Definition, NetworkSecurityGroupSecurityRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String securityRuleName; + + NetworkSecurityGroupSecurityRuleImpl(String name, NetworkManager manager) { + super(name, new SecurityRuleInner()); + this.manager = manager; + // Set resource name + this.securityRuleName = name; + // + } + + NetworkSecurityGroupSecurityRuleImpl(SecurityRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.securityRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.securityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "securityRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.inner().withAccess(access); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.inner().withDirection(direction); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.inner().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.inner().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.inner().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.inner().withDestinationPortRange(destinationPortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.inner().withDestinationPortRanges(destinationPortRanges); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withPriority(Integer priority) { + this.inner().withPriority(priority); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.inner().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.inner().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.inner().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.inner().withSourcePortRange(sourcePortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.inner().withSourcePortRanges(sourcePortRanges); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java new file mode 100644 index 0000000000000..28f0dd1e5b8c4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroupSecurityRuleModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleAccess; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleDirection; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleProtocol; + +class NetworkSecurityGroupSecurityRuleModelImpl extends IndexableRefreshableWrapperImpl implements NetworkSecurityGroupSecurityRuleModel { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String defaultSecurityRuleName; + + NetworkSecurityGroupSecurityRuleModelImpl(SecurityRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.defaultSecurityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "defaultSecurityRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DefaultSecurityRulesInner client = this.manager().inner().defaultSecurityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.defaultSecurityRuleName); + } + + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsImpl.java new file mode 100644 index 0000000000000..9572ae350da37 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkSecurityGroupsImpl extends GroupableResourcesCoreImpl implements NetworkSecurityGroups { + protected NetworkSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().networkSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(String name) { + return new NetworkSecurityGroupImpl(name, new NetworkSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsInner.java new file mode 100644 index 0000000000000..4f345f5579908 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkSecurityGroupsInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkSecurityGroups. + */ +public class NetworkSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network security group tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network security group tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @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 + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..41e1c1f56f572 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkWatcher; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; + +class NetworkWatcherImpl extends GroupableResourceCoreImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + NetworkWatcherImpl(String name, NetworkWatcherInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetworkWatcherImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkWatcherImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherInner.java new file mode 100644 index 0000000000000..01a0a0880d979 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatcherInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network watcher in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkWatcherInner extends Resource { + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersImpl.java new file mode 100644 index 0000000000000..a546b80a9225b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersImpl.java @@ -0,0 +1,300 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2019_02_01.NetworkWatcher; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.Topology; +import com.microsoft.azure.management.network.v2019_02_01.VerificationIPFlowResult; +import com.microsoft.azure.management.network.v2019_02_01.NextHopResult; +import com.microsoft.azure.management.network.v2019_02_01.SecurityGroupViewResult; +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingResult; +import com.microsoft.azure.management.network.v2019_02_01.FlowLogInformation; +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityInformation; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReport; +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersList; +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.management.network.v2019_02_01.TopologyParameters; +import com.microsoft.azure.management.network.v2019_02_01.VerificationIPFlowParameters; +import com.microsoft.azure.management.network.v2019_02_01.NextHopParameters; +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticParameters; + +class NetworkWatchersImpl extends GroupableResourcesCoreImpl implements NetworkWatchers { + protected NetworkWatchersImpl(NetworkManager manager) { + super(manager.inner().networkWatchers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkWatchersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkWatcherImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTopologyAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public Topology call(TopologyInner inner) { + return new TopologyImpl(inner, manager()); + } + }); + } + + @Override + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.verifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public VerificationIPFlowResult call(VerificationIPFlowResultInner inner) { + return new VerificationIPFlowResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNextHopAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NextHopResult call(NextHopResultInner inner) { + return new NextHopResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public SecurityGroupViewResult call(SecurityGroupViewResultInner inner) { + return new SecurityGroupViewResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + NetworkWatchersInner client = this.inner(); + return client.setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getFlowLogStatusAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public ConnectivityInformation call(ConnectivityInformationInner inner) { + return new ConnectivityInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AzureReachabilityReport call(AzureReachabilityReportInner inner) { + return new AzureReachabilityReportImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AvailableProvidersList call(AvailableProvidersListInner inner) { + return new AvailableProvidersListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, manager()); + } + }); + } + + @Override + protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { + return new NetworkWatcherImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkWatcherImpl wrapModel(String name) { + return new NetworkWatcherImpl(name, new NetworkWatcherInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersInner.java new file mode 100644 index 0000000000000..6e297b088ca5b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NetworkWatchersInner.java @@ -0,0 +1,2814 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2019_02_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2019_02_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2019_02_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2019_02_01.ErrorResponseException; +import com.microsoft.azure.management.network.v2019_02_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2019_02_01.NetworkConfigurationDiagnosticParameters; +import com.microsoft.azure.management.network.v2019_02_01.NextHopParameters; +import com.microsoft.azure.management.network.v2019_02_01.QueryTroubleshootingParameters; +import com.microsoft.azure.management.network.v2019_02_01.SecurityGroupViewParameters; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.management.network.v2019_02_01.TopologyParameters; +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2019_02_01.VerificationIPFlowParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkWatchers. + */ +public class NetworkWatchersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkWatchersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkWatchersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkWatchersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkWatchers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkWatchersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkWatcherInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getTopology" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology") + Observable> getTopology(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TopologyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers verifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> verifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginVerifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> beginVerifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> getNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> beginGetNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> getVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> beginGetVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> getTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> beginGetTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> getTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> beginGetTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers setFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> setFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginSetFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> beginSetFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> getFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> beginGetFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers checkConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> checkConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginCheckConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> beginCheckConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> getAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> beginGetAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers listAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> listAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginListAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> beginListAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers getNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> getNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.NetworkWatchers beginGetNetworkConfigurationDiagnostic" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + Observable> beginGetNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner createOrUpdate(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkWatcherInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkWatcherInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.createOrUpdate(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * 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 + * @return the observable to the NetworkWatcherInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NetworkWatcherInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().last().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates a network watcher tags. + * + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all network watchers by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopologyInner object if successful. + */ + public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the TopologyInner object + */ + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TopologyInner>() { + @Override + public TopologyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the TopologyInner object + */ + public Observable> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTopologyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTopologyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> verifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.verifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner beginVerifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable> beginVerifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginVerifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginVerifyIPFlowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.getNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the NextHopResultInner object + */ + public Observable beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the NextHopResultInner object + */ + public Observable> beginGetNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginGetNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNextHopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNextHopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner getVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * 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 targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner beginGetVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * 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 targetResourceId ID of the target VM. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable> beginGetVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVMSecurityRulesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVMSecurityRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.getTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginGetTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingResultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingResultDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner setFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> setFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.setFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginSetFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginSetFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetFlowLogConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetFlowLogConfigurationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner getFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginGetFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetFlowLogStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetFlowLogStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> checkConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.checkConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner beginCheckConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectivityInformationInner object + */ + public Observable beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectivityInformationInner object + */ + public Observable> beginCheckConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCheckConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCheckConnectivityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCheckConnectivityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.getAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable> beginGetAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAzureReachabilityReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAzureReachabilityReportDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner listAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> listAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.listAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner beginListAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the AvailableProvidersListInner object + */ + public Observable beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AvailableProvidersListInner object + */ + public Observable> beginListAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginListAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListAvailableProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListAvailableProvidersDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get network configuration diagnostic. + * + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @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 + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @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 + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Get network configuration diagnostic. + * + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @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 + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @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 + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..8948ed840d66b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NextHopResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.NextHopType; + +class NextHopResultImpl extends WrapperImpl implements NextHopResult { + private final NetworkManager manager; + NextHopResultImpl(NextHopResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public NextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String routeTableId() { + return this.inner().routeTableId(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultInner.java new file mode 100644 index 0000000000000..52a2509f44dc2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/NextHopResultInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.NextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about next hop from the specified VM. + */ +public class NextHopResultInner { + /** + * Next hop type. Possible values include: 'Internet', 'VirtualAppliance', + * 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + */ + @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 next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @return the nextHopType value + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get next hop IP Address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set 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 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..0238cec7bfd92 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.OperationDisplay; +import com.microsoft.azure.management.network.v2019_02_01.OperationPropertiesFormatServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetworkManager manager; + OperationImpl(OperationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..67c902e9d969c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.OperationDisplay; +import com.microsoft.azure.management.network.v2019_02_01.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Network REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Specification of the service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set 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 origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set 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 specification of the service. + * + * @return the serviceSpecification value + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set specification of the service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..4eb49baad1aa3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetworkManager manager; + + OperationsImpl(NetworkManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..beb708c65c5a2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Operations list" }) + @GET("providers/Microsoft.Network/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2019-02-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleImpl.java new file mode 100644 index 0000000000000..1a92e3ce9b156 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.OutboundRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRuleProtocol; + +class OutboundRuleImpl extends IndexableRefreshableWrapperImpl implements OutboundRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String outboundRuleName; + + OutboundRuleImpl(OutboundRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.outboundRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "outboundRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerOutboundRulesInner client = this.manager().inner().loadBalancerOutboundRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.outboundRuleName); + } + + + + @Override + public Integer allocatedOutboundPorts() { + return this.inner().allocatedOutboundPorts(); + } + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Boolean enableTcpReset() { + return this.inner().enableTcpReset(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public LoadBalancerOutboundRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleInner.java new file mode 100644 index 0000000000000..4aa2873aab15c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/OutboundRuleInner.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.LoadBalancerOutboundRuleProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Outbound pool of the load balancer. + */ +@JsonFlatten +public class OutboundRuleInner extends SubResource { + /** + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "properties.allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /** + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations", 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 = "properties.backendAddressPool", required = true) + private SubResource backendAddressPool; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The protocol for the outbound rule in load balancer. Possible values + * are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', + * 'All'. + */ + @JsonProperty(value = "properties.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 = "properties.enableTcpReset") + private Boolean enableTcpReset; + + /** + * The timeout for the TCP idle connection. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * 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") + private String etag; + + /** + * Get the number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the number of outbound ports to be used for NAT. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the Frontend IP addresses of the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set the Frontend IP addresses of the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get 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 a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the protocol for the outbound rule in load balancer. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public LoadBalancerOutboundRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol for the outbound rule in load balancer. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withProtocol(LoadBalancerOutboundRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + * + * @param enableTcpReset the enableTcpReset value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get 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 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 OutboundRuleInner object itself. + */ + public OutboundRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the OutboundRuleInner object itself. + */ + public OutboundRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayImpl.java new file mode 100644 index 0000000000000..f2e2cadaccf3e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientConnectionHealth; + +class P2SVpnGatewayImpl extends GroupableResourceCoreImpl implements P2SVpnGateway, P2SVpnGateway.Definition, P2SVpnGateway.Update { + P2SVpnGatewayImpl(String name, P2SVpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + P2sVpnGatewaysInner client = this.manager().inner().p2sVpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace customRoutes() { + return this.inner().customRoutes(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource p2SVpnServerConfiguration() { + return this.inner().p2SVpnServerConfiguration(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public AddressSpace vpnClientAddressPool() { + return this.inner().vpnClientAddressPool(); + } + + @Override + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.inner().vpnClientConnectionHealth(); + } + + @Override + public Integer vpnGatewayScaleUnit() { + return this.inner().vpnGatewayScaleUnit(); + } + + @Override + public P2SVpnGatewayImpl withCustomRoutes(AddressSpace customRoutes) { + this.inner().withCustomRoutes(customRoutes); + return this; + } + + @Override + public P2SVpnGatewayImpl withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { + this.inner().withP2SVpnServerConfiguration(p2SVpnServerConfiguration); + return this; + } + + @Override + public P2SVpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public P2SVpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public P2SVpnGatewayImpl withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.inner().withVpnClientAddressPool(vpnClientAddressPool); + return this; + } + + @Override + public P2SVpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.inner().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayInner.java new file mode 100644 index 0000000000000..220dee730c242 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnGatewayInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * P2SVpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class P2SVpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The scale unit for this p2s vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /** + * The P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + */ + @JsonProperty(value = "properties.p2SVpnServerConfiguration") + private SubResource p2SVpnServerConfiguration; + + /** + * The reference of the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "properties.vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /** + * The reference of the address space resource which represents the custom + * routes specified by the customer for P2SVpnGateway and P2S VpnClient. + */ + @JsonProperty(value = "properties.customRoutes") + private AddressSpace customRoutes; + + /** + * All P2S VPN clients' connection health status. + */ + @JsonProperty(value = "properties.vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY) + private VpnClientConnectionHealth vpnClientConnectionHealth; + + /** + * Gets 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 VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the scale unit for this p2s vpn gateway. + * + * @return the vpnGatewayScaleUnit value + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the scale unit for this p2s vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get the P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @return the p2SVpnServerConfiguration value + */ + public SubResource p2SVpnServerConfiguration() { + return this.p2SVpnServerConfiguration; + } + + /** + * Set the P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. + * + * @param p2SVpnServerConfiguration the p2SVpnServerConfiguration value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withP2SVpnServerConfiguration(SubResource p2SVpnServerConfiguration) { + this.p2SVpnServerConfiguration = p2SVpnServerConfiguration; + return this; + } + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get the reference of the address space resource which represents the custom routes specified by the customer for P2SVpnGateway and P2S VpnClient. + * + * @return the customRoutes value + */ + public AddressSpace customRoutes() { + return this.customRoutes; + } + + /** + * Set the reference of the address space resource which represents the custom routes specified by the customer for P2SVpnGateway and P2S VpnClient. + * + * @param customRoutes the customRoutes value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withCustomRoutes(AddressSpace customRoutes) { + this.customRoutes = customRoutes; + return this; + } + + /** + * Get all P2S VPN clients' connection health status. + * + * @return the vpnClientConnectionHealth value + */ + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.vpnClientConnectionHealth; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationImpl.java new file mode 100644 index 0000000000000..380556ade754f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationImpl.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VpnGatewayTunnelingProtocol; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigVpnClientRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigVpnClientRevokedCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigRadiusServerRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigRadiusClientRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.SubResource; + +class P2SVpnServerConfigurationImpl extends CreatableUpdatableImpl implements P2SVpnServerConfiguration, P2SVpnServerConfiguration.Definition, P2SVpnServerConfiguration.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualWanName; + private String p2SVpnServerConfigurationName; + + P2SVpnServerConfigurationImpl(String name, NetworkManager manager) { + super(name, new P2SVpnServerConfigurationInner()); + this.manager = manager; + // Set resource name + this.p2SVpnServerConfigurationName = name; + // + } + + P2SVpnServerConfigurationImpl(P2SVpnServerConfigurationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.p2SVpnServerConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualWanName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualWans"); + this.p2SVpnServerConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "p2sVpnServerConfigurations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + P2sVpnServerConfigurationsInner client = this.manager().inner().p2sVpnServerConfigurations(); + return client.getAsync(this.resourceGroupName, this.virtualWanName, this.p2SVpnServerConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List p2SVpnGateways() { + return this.inner().p2SVpnGateways(); + } + + @Override + public List p2SVpnServerConfigRadiusClientRootCertificates() { + return this.inner().p2SVpnServerConfigRadiusClientRootCertificates(); + } + + @Override + public List p2SVpnServerConfigRadiusServerRootCertificates() { + return this.inner().p2SVpnServerConfigRadiusServerRootCertificates(); + } + + @Override + public String p2SVpnServerConfigurationPropertiesEtag() { + return this.inner().p2SVpnServerConfigurationPropertiesEtag(); + } + + @Override + public String p2SVpnServerConfigurationPropertiesName() { + return this.inner().p2SVpnServerConfigurationPropertiesName(); + } + + @Override + public List p2SVpnServerConfigVpnClientRevokedCertificates() { + return this.inner().p2SVpnServerConfigVpnClientRevokedCertificates(); + } + + @Override + public List p2SVpnServerConfigVpnClientRootCertificates() { + return this.inner().p2SVpnServerConfigVpnClientRootCertificates(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String radiusServerAddress() { + return this.inner().radiusServerAddress(); + } + + @Override + public String radiusServerSecret() { + return this.inner().radiusServerSecret(); + } + + @Override + public List vpnClientIpsecPolicies() { + return this.inner().vpnClientIpsecPolicies(); + } + + @Override + public List vpnProtocols() { + return this.inner().vpnProtocols(); + } + + @Override + public P2SVpnServerConfigurationImpl withExistingVirtualWan(String resourceGroupName, String virtualWanName) { + this.resourceGroupName = resourceGroupName; + this.virtualWanName = virtualWanName; + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates) { + this.inner().withP2SVpnServerConfigRadiusClientRootCertificates(p2SVpnServerConfigRadiusClientRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates) { + this.inner().withP2SVpnServerConfigRadiusServerRootCertificates(p2SVpnServerConfigRadiusServerRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag) { + this.inner().withP2SVpnServerConfigurationPropertiesEtag(p2SVpnServerConfigurationPropertiesEtag); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName) { + this.inner().withP2SVpnServerConfigurationPropertiesName(p2SVpnServerConfigurationPropertiesName); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates) { + this.inner().withP2SVpnServerConfigVpnClientRevokedCertificates(p2SVpnServerConfigVpnClientRevokedCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates) { + this.inner().withP2SVpnServerConfigVpnClientRootCertificates(p2SVpnServerConfigVpnClientRootCertificates); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withRadiusServerAddress(String radiusServerAddress) { + this.inner().withRadiusServerAddress(radiusServerAddress); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withRadiusServerSecret(String radiusServerSecret) { + this.inner().withRadiusServerSecret(radiusServerSecret); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.inner().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); + return this; + } + + @Override + public P2SVpnServerConfigurationImpl withVpnProtocols(List vpnProtocols) { + this.inner().withVpnProtocols(vpnProtocols); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationInner.java new file mode 100644 index 0000000000000..6ea53839f8236 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2SVpnServerConfigurationInner.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VpnGatewayTunnelingProtocol; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigVpnClientRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigVpnClientRevokedCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigRadiusServerRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfigRadiusClientRootCertificate; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * P2SVpnServerConfiguration Resource. + */ +@JsonFlatten +public class P2SVpnServerConfigurationInner extends SubResource { + /** + * The name of the P2SVpnServerConfiguration that is unique within a + * VirtualWan in a resource group. This name can be used to access the + * resource along with Paren VirtualWan resource name. + */ + @JsonProperty(value = "properties.name") + private String p2SVpnServerConfigurationPropertiesName; + + /** + * VPN protocols for the P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnProtocols") + private List vpnProtocols; + + /** + * VPN client root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigVpnClientRootCertificates") + private List p2SVpnServerConfigVpnClientRootCertificates; + + /** + * VPN client revoked certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigVpnClientRevokedCertificates") + private List p2SVpnServerConfigVpnClientRevokedCertificates; + + /** + * Radius Server root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigRadiusServerRootCertificates") + private List p2SVpnServerConfigRadiusServerRootCertificates; + + /** + * Radius client root certificate of P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigRadiusClientRootCertificates") + private List p2SVpnServerConfigRadiusClientRootCertificates; + + /** + * VpnClientIpsecPolicies for P2SVpnServerConfiguration. + */ + @JsonProperty(value = "properties.vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /** + * The radius server address property of the P2SVpnServerConfiguration + * resource for point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerAddress") + private String radiusServerAddress; + + /** + * The radius secret property of the P2SVpnServerConfiguration resource for + * point to site client connection. + */ + @JsonProperty(value = "properties.radiusServerSecret") + private String radiusServerSecret; + + /** + * The provisioning state of the P2SVpnServerConfiguration resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * List of references to P2SVpnGateways. + */ + @JsonProperty(value = "properties.p2SVpnGateways", access = JsonProperty.Access.WRITE_ONLY) + private List p2SVpnGateways; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "properties.etag") + private String p2SVpnServerConfigurationPropertiesEtag; + + /** + * 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; + + /** + * Gets 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 of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name. + * + * @return the p2SVpnServerConfigurationPropertiesName value + */ + public String p2SVpnServerConfigurationPropertiesName() { + return this.p2SVpnServerConfigurationPropertiesName; + } + + /** + * Set the name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource group. This name can be used to access the resource along with Paren VirtualWan resource name. + * + * @param p2SVpnServerConfigurationPropertiesName the p2SVpnServerConfigurationPropertiesName value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigurationPropertiesName(String p2SVpnServerConfigurationPropertiesName) { + this.p2SVpnServerConfigurationPropertiesName = p2SVpnServerConfigurationPropertiesName; + return this; + } + + /** + * Get vPN protocols for the P2SVpnServerConfiguration. + * + * @return the vpnProtocols value + */ + public List vpnProtocols() { + return this.vpnProtocols; + } + + /** + * Set vPN protocols for the P2SVpnServerConfiguration. + * + * @param vpnProtocols the vpnProtocols value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withVpnProtocols(List vpnProtocols) { + this.vpnProtocols = vpnProtocols; + return this; + } + + /** + * Get vPN client root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigVpnClientRootCertificates value + */ + public List p2SVpnServerConfigVpnClientRootCertificates() { + return this.p2SVpnServerConfigVpnClientRootCertificates; + } + + /** + * Set vPN client root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigVpnClientRootCertificates the p2SVpnServerConfigVpnClientRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRootCertificates(List p2SVpnServerConfigVpnClientRootCertificates) { + this.p2SVpnServerConfigVpnClientRootCertificates = p2SVpnServerConfigVpnClientRootCertificates; + return this; + } + + /** + * Get vPN client revoked certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigVpnClientRevokedCertificates value + */ + public List p2SVpnServerConfigVpnClientRevokedCertificates() { + return this.p2SVpnServerConfigVpnClientRevokedCertificates; + } + + /** + * Set vPN client revoked certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigVpnClientRevokedCertificates the p2SVpnServerConfigVpnClientRevokedCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRevokedCertificates(List p2SVpnServerConfigVpnClientRevokedCertificates) { + this.p2SVpnServerConfigVpnClientRevokedCertificates = p2SVpnServerConfigVpnClientRevokedCertificates; + return this; + } + + /** + * Get radius Server root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigRadiusServerRootCertificates value + */ + public List p2SVpnServerConfigRadiusServerRootCertificates() { + return this.p2SVpnServerConfigRadiusServerRootCertificates; + } + + /** + * Set radius Server root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigRadiusServerRootCertificates the p2SVpnServerConfigRadiusServerRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusServerRootCertificates(List p2SVpnServerConfigRadiusServerRootCertificates) { + this.p2SVpnServerConfigRadiusServerRootCertificates = p2SVpnServerConfigRadiusServerRootCertificates; + return this; + } + + /** + * Get radius client root certificate of P2SVpnServerConfiguration. + * + * @return the p2SVpnServerConfigRadiusClientRootCertificates value + */ + public List p2SVpnServerConfigRadiusClientRootCertificates() { + return this.p2SVpnServerConfigRadiusClientRootCertificates; + } + + /** + * Set radius client root certificate of P2SVpnServerConfiguration. + * + * @param p2SVpnServerConfigRadiusClientRootCertificates the p2SVpnServerConfigRadiusClientRootCertificates value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusClientRootCertificates(List p2SVpnServerConfigRadiusClientRootCertificates) { + this.p2SVpnServerConfigRadiusClientRootCertificates = p2SVpnServerConfigRadiusClientRootCertificates; + return this; + } + + /** + * Get vpnClientIpsecPolicies for P2SVpnServerConfiguration. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set vpnClientIpsecPolicies for P2SVpnServerConfiguration. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radius server address property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radius server address property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radius secret property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radius secret property of the P2SVpnServerConfiguration resource for point to site client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Get the provisioning state of the P2SVpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get list of references to P2SVpnGateways. + * + * @return the p2SVpnGateways value + */ + public List p2SVpnGateways() { + return this.p2SVpnGateways; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the p2SVpnServerConfigurationPropertiesEtag value + */ + public String p2SVpnServerConfigurationPropertiesEtag() { + return this.p2SVpnServerConfigurationPropertiesEtag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param p2SVpnServerConfigurationPropertiesEtag the p2SVpnServerConfigurationPropertiesEtag value to set + * @return the P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withP2SVpnServerConfigurationPropertiesEtag(String p2SVpnServerConfigurationPropertiesEtag) { + this.p2SVpnServerConfigurationPropertiesEtag = p2SVpnServerConfigurationPropertiesEtag; + return this; + } + + /** + * Get 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 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 P2SVpnServerConfigurationInner object itself. + */ + public P2SVpnServerConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysImpl.java new file mode 100644 index 0000000000000..643300d81fba4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.VpnProfileResponse; + +class P2sVpnGatewaysImpl extends GroupableResourcesCoreImpl implements P2sVpnGateways { + protected P2sVpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().p2sVpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + P2sVpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + P2sVpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + P2sVpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + P2sVpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnGateway call(P2SVpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + P2sVpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + P2sVpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnGateway call(P2SVpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public P2SVpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName) { + P2sVpnGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, gatewayName) + .map(new Func1() { + @Override + public VpnProfileResponse call(VpnProfileResponseInner inner) { + return new VpnProfileResponseImpl(inner, manager()); + } + }); + } + + @Override + protected P2SVpnGatewayImpl wrapModel(P2SVpnGatewayInner inner) { + return new P2SVpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected P2SVpnGatewayImpl wrapModel(String name) { + return new P2SVpnGatewayImpl(name, new P2SVpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysInner.java new file mode 100644 index 0000000000000..0a454b328da37 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnGatewaysInner.java @@ -0,0 +1,1603 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.AuthenticationMethod; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnProfileParameters; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in P2sVpnGateways. + */ +public class P2sVpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private P2sVpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2sVpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public P2sVpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(P2sVpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for P2sVpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface P2sVpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body P2SVpnGatewayInner p2SVpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body P2SVpnGatewayInner p2SVpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject p2SVpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject p2SVpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body P2SVpnProfileParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways beginGenerateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile") + Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body P2SVpnProfileParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (p2SVpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null."); + } + Validator.validate(p2SVpnGatewayParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, p2SVpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (p2SVpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnGatewayParameters is required and cannot be null."); + } + Validator.validate(p2SVpnGatewayParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, p2SVpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnGatewayInner object if successful. + */ + public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, P2SVpnGatewayInner>() { + @Override + public P2SVpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject p2SVpnGatewayParameters = new TagsObject(); + p2SVpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), p2SVpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner generateVpnProfile(String resourceGroupName, String gatewayName) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final AuthenticationMethod authenticationMethod = null; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(null); + Observable> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner generateVpnProfile(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).toBlocking().last().body(); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod), serviceCallback); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(authenticationMethod); + Observable> observable = service.generateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner beginGenerateVpnProfile(String resourceGroupName, String gatewayName) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final AuthenticationMethod authenticationMethod = null; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(null); + return service.beginGenerateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnProfileResponseInner object if successful. + */ + public VpnProfileResponseInner beginGenerateVpnProfile(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).toBlocking().single().body(); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod), serviceCallback); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, gatewayName, authenticationMethod).map(new Func1, VpnProfileResponseInner>() { + @Override + public VpnProfileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 authenticationMethod VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnProfileResponseInner object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String gatewayName, AuthenticationMethod authenticationMethod) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + P2SVpnProfileParameters parameters = new P2SVpnProfileParameters(); + parameters.withAuthenticationMethod(authenticationMethod); + return service.beginGenerateVpnProfile(resourceGroupName, gatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsImpl.java new file mode 100644 index 0000000000000..e4d8c83aa97e9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfiguration; + +class P2sVpnServerConfigurationsImpl extends WrapperImpl implements P2sVpnServerConfigurations { + private final NetworkManager manager; + + P2sVpnServerConfigurationsImpl(NetworkManager manager) { + super(manager.inner().p2sVpnServerConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public P2SVpnServerConfigurationImpl define(String name) { + return wrapModel(name); + } + + private P2SVpnServerConfigurationImpl wrapModel(P2SVpnServerConfigurationInner inner) { + return new P2SVpnServerConfigurationImpl(inner, manager()); + } + + private P2SVpnServerConfigurationImpl wrapModel(String name) { + return new P2SVpnServerConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.listByVirtualWanAsync(resourceGroupName, virtualWanName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public P2SVpnServerConfiguration call(P2SVpnServerConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName) + .map(new Func1() { + @Override + public P2SVpnServerConfiguration call(P2SVpnServerConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + P2sVpnServerConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsInner.java new file mode 100644 index 0000000000000..a60f40531b970 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/P2sVpnServerConfigurationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in P2sVpnServerConfigurations. + */ +public class P2sVpnServerConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private P2sVpnServerConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2sVpnServerConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public P2sVpnServerConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(P2sVpnServerConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for P2sVpnServerConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface P2sVpnServerConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Body P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Body P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Path("p2SVpnServerConfigurationName") String p2SVpnServerConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations listByVirtualWan" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWanName}/p2sVpnServerConfigurations") + Observable> listByVirtualWan(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWanName") String virtualWanName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.P2sVpnServerConfigurations listByVirtualWanNext" }) + @GET + Observable> listByVirtualWanNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner get(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner createOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).toBlocking().last().body(); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters), serviceCallback); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + if (p2SVpnServerConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationParameters is required and cannot be null."); + } + Validator.validate(p2SVpnServerConfigurationParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, p2SVpnServerConfigurationParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the P2SVpnServerConfigurationInner object if successful. + */ + public P2SVpnServerConfigurationInner beginCreateOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).toBlocking().single().body(); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters), serviceCallback); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters).map(new Func1, P2SVpnServerConfigurationInner>() { + @Override + public P2SVpnServerConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the P2SVpnServerConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + if (p2SVpnServerConfigurationParameters == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationParameters is required and cannot be null."); + } + Validator.validate(p2SVpnServerConfigurationParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, p2SVpnServerConfigurationParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().last().body(); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().single().body(); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName), serviceCallback); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a P2SVpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. + * @param virtualWanName The name of the VirtualWan. + * @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + if (p2SVpnServerConfigurationName == null) { + throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnServerConfigurationInner> object if successful. + */ + public PagedList listByVirtualWan(final String resourceGroupName, final String virtualWanName) { + ServiceResponse> response = listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable> listByVirtualWanAsync(final String resourceGroupName, final String virtualWanName) { + return listByVirtualWanWithServiceResponseAsync(resourceGroupName, virtualWanName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable>> listByVirtualWanWithServiceResponseAsync(final String resourceGroupName, final String virtualWanName) { + return listByVirtualWanSinglePageAsync(resourceGroupName, virtualWanName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualWanNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + ServiceResponse> * @param virtualWanName The name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnServerConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualWanSinglePageAsync(final String resourceGroupName, final String virtualWanName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWanName == null) { + throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByVirtualWan(this.client.subscriptionId(), resourceGroupName, virtualWanName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualWanDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualWanDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<P2SVpnServerConfigurationInner> object if successful. + */ + public PagedList listByVirtualWanNext(final String nextPageLink) { + ServiceResponse> response = listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualWanNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualWanNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable> listByVirtualWanNextAsync(final String nextPageLink) { + return listByVirtualWanNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<P2SVpnServerConfigurationInner> object + */ + public Observable>> listByVirtualWanNextWithServiceResponseAsync(final String nextPageLink) { + return listByVirtualWanNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualWanNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<P2SVpnServerConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualWanNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVirtualWanNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualWanNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualWanNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureInner.java new file mode 100644 index 0000000000000..17f37a0aa0442 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the create packet capture operation. + */ +@JsonFlatten +public class PacketCaptureInner { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * Describes the storage location for a packet capture session. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * A list of packet capture filters. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get describes the storage location for a packet capture session. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set describes the storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get a list of packet capture filters. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set a list of packet capture filters. + * + * @param filters the filters value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..2d73e734c2bb4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PcError; +import com.microsoft.azure.management.network.v2019_02_01.PcStatus; + +class PacketCaptureQueryStatusResultImpl extends WrapperImpl implements PacketCaptureQueryStatusResult { + private final NetworkManager manager; + PacketCaptureQueryStatusResultImpl(PacketCaptureQueryStatusResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime captureStartTime() { + return this.inner().captureStartTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List packetCaptureError() { + return this.inner().packetCaptureError(); + } + + @Override + public PcStatus packetCaptureStatus() { + return this.inner().packetCaptureStatus(); + } + + @Override + public String stopReason() { + return this.inner().stopReason(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 0000000000000..672174f565a8b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.network.v2019_02_01.PcStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PcError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of packet capture session. + */ +public class PacketCaptureQueryStatusResultInner { + /** + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private DateTime captureStartTime; + + /** + * The status of the packet capture session. Possible values include: + * 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + */ + @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 of the packet capture resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the packet capture resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 start time of the packet capture session. + * + * @return the captureStartTime value + */ + public DateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(DateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @return the packetCaptureStatus value + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @param packetCaptureStatus the packetCaptureStatus value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the reason the current packet capture session was stopped. + * + * @return the stopReason value + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set 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 list of errors of packet capture session. + * + * @return the packetCaptureError value + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..6de21b786c292 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import rx.functions.Func1; + +class PacketCaptureResultImpl extends CreatableUpdatableImpl implements PacketCaptureResult, PacketCaptureResult.Definition, PacketCaptureResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String packetCaptureName; + private PacketCaptureInner createOrUpdateParameter; + + PacketCaptureResultImpl(String name, NetworkManager manager) { + super(name, new PacketCaptureResultInner()); + this.manager = manager; + // Set resource name + this.packetCaptureName = name; + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + PacketCaptureResultImpl(PacketCaptureResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.packetCaptureName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.packetCaptureName = IdParsingUtils.getValueFromIdByName(inner.id(), "packetCaptures"); + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public Integer bytesToCapturePerPacket() { + return this.inner().bytesToCapturePerPacket(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List filters() { + return this.inner().filters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PacketCaptureStorageLocation storageLocation() { + return this.inner().storageLocation(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public Integer timeLimitInSeconds() { + return this.inner().timeLimitInSeconds(); + } + + @Override + public Integer totalBytesPerSession() { + return this.inner().totalBytesPerSession(); + } + + @Override + public PacketCaptureResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public PacketCaptureResultImpl withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.createOrUpdateParameter.withStorageLocation(storageLocation); + return this; + } + + @Override + public PacketCaptureResultImpl withTarget(String target) { + this.createOrUpdateParameter.withTarget(target); + return this; + } + + @Override + public PacketCaptureResultImpl withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.createOrUpdateParameter.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + @Override + public PacketCaptureResultImpl withFilters(List filters) { + this.createOrUpdateParameter.withFilters(filters); + return this; + } + + @Override + public PacketCaptureResultImpl withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.createOrUpdateParameter.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + @Override + public PacketCaptureResultImpl withTotalBytesPerSession(Integer totalBytesPerSession) { + this.createOrUpdateParameter.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultInner.java new file mode 100644 index 0000000000000..b91d1560b38bb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCaptureResultInner.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about packet capture session. + */ +@JsonFlatten +public class PacketCaptureResultInner { + /** + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * Describes the storage location for a packet capture session. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * A list of packet capture filters. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * The provisioning state of the packet capture session. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get name of the packet capture session. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get iD of the packet capture operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set 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(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get describes the storage location for a packet capture session. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set describes the storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get a list of packet capture filters. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set a list of packet capture filters. + * + * @param filters the filters value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesImpl.java new file mode 100644 index 0000000000000..8753b415d3419 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptures; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.management.network.v2019_02_01.PacketCaptureResult; + +class PacketCapturesImpl extends WrapperImpl implements PacketCaptures { + private final NetworkManager manager; + + PacketCapturesImpl(NetworkManager manager) { + super(manager.inner().packetCaptures()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public PacketCaptureResultImpl define(String name) { + return wrapModel(name); + } + + private PacketCaptureResultImpl wrapModel(PacketCaptureResultInner inner) { + return new PacketCaptureResultImpl(inner, manager()); + } + + private PacketCaptureResultImpl wrapModel(String name) { + return new PacketCaptureResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + + @Override + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureQueryStatusResult call(PacketCaptureQueryStatusResultInner inner) { + return new PacketCaptureQueryStatusResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + PacketCapturesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesInner.java new file mode 100644 index 0000000000000..450562b2ebb36 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PacketCapturesInner.java @@ -0,0 +1,961 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2019_02_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in PacketCaptures. + */ +public class PacketCapturesInner { + /** The Retrofit service to perform REST calls. */ + private PacketCapturesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PacketCapturesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PacketCapturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PacketCaptures to be + * used by Retrofit to perform actually REST calls. + */ + interface PacketCapturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures getStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> getStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures beginGetStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> beginGetStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PacketCaptures list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner create(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.create(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the PacketCaptureResultInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PacketCaptureResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner getStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable> beginGetStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException 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<PacketCaptureResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..32545e71d1576 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl1.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..dca1f722fb144 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..a88123484cb3e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnection; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.CircuitConnectionStatus; +import com.microsoft.azure.SubResource; + +class PeerExpressRouteCircuitConnectionImpl extends IndexableRefreshableWrapperImpl implements PeerExpressRouteCircuitConnection { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + private String connectionName; + + PeerExpressRouteCircuitConnectionImpl(PeerExpressRouteCircuitConnectionInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerConnections"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + PeerExpressRouteCircuitConnectionsInner client = this.manager().inner().peerExpressRouteCircuitConnections(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName); + } + + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authResourceGuid() { + return this.inner().authResourceGuid(); + } + + @Override + public CircuitConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String connectionName() { + return this.inner().connectionName(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peerExpressRouteCircuitPeering() { + return this.inner().peerExpressRouteCircuitPeering(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionInner.java new file mode 100644 index 0000000000000..d0db425c1b974 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionInner.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.CircuitConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ +@JsonFlatten +public class PeerExpressRouteCircuitConnectionInner extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the + * circuit. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /** + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * Express Route Circuit connection state. Possible values include: + * 'Connected', 'Connecting', 'Disconnected'. + */ + @JsonProperty(value = "properties.circuitConnectionStatus") + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * The name of the express route circuit connection resource. + */ + @JsonProperty(value = "properties.connectionName") + private String connectionName; + + /** + * The resource guid of the authorization used for the express route + * circuit connection. + */ + @JsonProperty(value = "properties.authResourceGuid") + private String authResourceGuid; + + /** + * Provisioning state of the peer express route circuit connection + * resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and + * 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets 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 reference to Express Route Circuit Private Peering Resource of the circuit. + * + * @return the expressRouteCircuitPeering value + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the circuit. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Set express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @param circuitConnectionStatus the circuitConnectionStatus value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withCircuitConnectionStatus(CircuitConnectionStatus circuitConnectionStatus) { + this.circuitConnectionStatus = circuitConnectionStatus; + return this; + } + + /** + * Get the name of the express route circuit connection resource. + * + * @return the connectionName value + */ + public String connectionName() { + return this.connectionName; + } + + /** + * Set the name of the express route circuit connection resource. + * + * @param connectionName the connectionName value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withConnectionName(String connectionName) { + this.connectionName = connectionName; + return this; + } + + /** + * Get the resource guid of the authorization used for the express route circuit connection. + * + * @return the authResourceGuid value + */ + public String authResourceGuid() { + return this.authResourceGuid; + } + + /** + * Set the resource guid of the authorization used for the express route circuit connection. + * + * @param authResourceGuid the authResourceGuid value to set + * @return the PeerExpressRouteCircuitConnectionInner object itself. + */ + public PeerExpressRouteCircuitConnectionInner withAuthResourceGuid(String authResourceGuid) { + this.authResourceGuid = authResourceGuid; + return this; + } + + /** + * Get provisioning state of the peer express route circuit connection resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets 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 gets 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 0000000000000..939fd67787600 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnections; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnection; + +class PeerExpressRouteCircuitConnectionsImpl extends WrapperImpl implements PeerExpressRouteCircuitConnections { + private final NetworkManager manager; + + PeerExpressRouteCircuitConnectionsImpl(NetworkManager manager) { + super(manager.inner().peerExpressRouteCircuitConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private PeerExpressRouteCircuitConnectionImpl wrapModel(PeerExpressRouteCircuitConnectionInner inner) { + return new PeerExpressRouteCircuitConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + PeerExpressRouteCircuitConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName, peeringName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PeerExpressRouteCircuitConnection call(PeerExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + PeerExpressRouteCircuitConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName, connectionName) + .map(new Func1() { + @Override + public PeerExpressRouteCircuitConnection call(PeerExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsInner.java new file mode 100644 index 0000000000000..c1709f84abae0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PeerExpressRouteCircuitConnectionsInner.java @@ -0,0 +1,412 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PeerExpressRouteCircuitConnections. + */ +public class PeerExpressRouteCircuitConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PeerExpressRouteCircuitConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PeerExpressRouteCircuitConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PeerExpressRouteCircuitConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PeerExpressRouteCircuitConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PeerExpressRouteCircuitConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PeerExpressRouteCircuitConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PeerExpressRouteCircuitConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PeerExpressRouteCircuitConnectionInner object if successful. + */ + public PeerExpressRouteCircuitConnectionInner get(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PeerExpressRouteCircuitConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, PeerExpressRouteCircuitConnectionInner>() { + @Override + public PeerExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PeerExpressRouteCircuitConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PeerExpressRouteCircuitConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName, final String peeringName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName, peeringName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final String peeringName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName, peeringName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PeerExpressRouteCircuitConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PeerExpressRouteCircuitConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + return listSinglePageAsync(resourceGroupName, circuitName, peeringName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + ServiceResponse> * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PeerExpressRouteCircuitConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName, final String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PeerExpressRouteCircuitConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PeerExpressRouteCircuitConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PeerExpressRouteCircuitConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PeerExpressRouteCircuitConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..422cf604551d8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Probe; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProbeProtocol; + +class ProbeImpl extends IndexableRefreshableWrapperImpl implements Probe { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String probeName; + + ProbeImpl(ProbeInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerProbesInner client = this.manager().inner().loadBalancerProbes(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.probeName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer intervalInSeconds() { + return this.inner().intervalInSeconds(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer numberOfProbes() { + return this.inner().numberOfProbes(); + } + + @Override + public int port() { + return this.inner().port(); + } + + @Override + public ProbeProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String requestPath() { + return this.inner().requestPath(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeInner.java new file mode 100644 index 0000000000000..8facc51d6b049 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ProbeInner.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ProbeProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancer probe. + */ +@JsonFlatten +public class ProbeInner extends SubResource { + /** + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The protocol of the end point. Possible values are: 'Http', 'Tcp', or + * 'Https'. 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. + * Possible values include: 'Http', 'Tcp', 'Https'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private ProbeProtocol protocol; + + /** + * The port for communicating the probe. Possible values range from 1 to + * 65535, inclusive. + */ + @JsonProperty(value = "properties.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 = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The number of probes where if no response, will result in stopping + * further traffic from being delivered to the endpoint. This values allows + * endpoints to be taken out of rotation faster or slower than the typical + * times used in Azure. + */ + @JsonProperty(value = "properties.numberOfProbes") + private Integer numberOfProbes; + + /** + * The URI used for requesting health status from the VM. Path is required + * if a protocol is set to http. Otherwise, it is not allowed. There is no + * default value. + */ + @JsonProperty(value = "properties.requestPath") + private String requestPath; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets 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") + private String etag; + + /** + * Get the load balancer rules that use this probe. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. 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. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @return the protocol value + */ + public ProbeProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. 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. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @param protocol the protocol value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProtocol(ProbeProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port 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 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(int port) { + this.port = port; + return this; + } + + /** + * Get 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 interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the 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 number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @param numberOfProbes the numberOfProbes value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the 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 URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @param requestPath the requestPath value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets 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 gets 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 ProbeInner object itself. + */ + public ProbeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressImpl.java new file mode 100644 index 0000000000000..3b437fc754222 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddress; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import com.microsoft.azure.management.network.v2019_02_01.IPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddressDnsSettings; +import com.microsoft.azure.management.network.v2019_02_01.DdosSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpTag; +import com.microsoft.azure.SubResource; + +class PublicIPAddressImpl extends GroupableResourceCoreImpl implements PublicIPAddress, PublicIPAddress.Definition, PublicIPAddress.Update { + PublicIPAddressImpl(String name, PublicIPAddressInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DdosSettings ddosSettings() { + return this.inner().ddosSettings(); + } + + @Override + public PublicIPAddressDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public IPConfiguration ipConfiguration() { + return this.inner().ipConfiguration(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public IPAllocationMethod publicIPAllocationMethod() { + return this.inner().publicIPAllocationMethod(); + } + + @Override + public SubResource publicIPPrefix() { + return this.inner().publicIPPrefix(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPAddressSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPAddressImpl withDdosSettings(DdosSettings ddosSettings) { + this.inner().withDdosSettings(ddosSettings); + return this; + } + + @Override + public PublicIPAddressImpl withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public PublicIPAddressImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public PublicIPAddressImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public PublicIPAddressImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPAddressImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.inner().withPublicIPAllocationMethod(publicIPAllocationMethod); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPPrefix(SubResource publicIPPrefix) { + this.inner().withPublicIPPrefix(publicIPPrefix); + return this; + } + + @Override + public PublicIPAddressImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPAddressImpl withSku(PublicIPAddressSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPAddressImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressInner.java new file mode 100644 index 0000000000000..7101bc426c0ed --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressInner.java @@ -0,0 +1,413 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import com.microsoft.azure.management.network.v2019_02_01.IPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddressDnsSettings; +import com.microsoft.azure.management.network.v2019_02_01.DdosSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpTag; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP address resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPAddressInner extends Resource { + /** + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIPAddressSku sku; + + /** + * The public IP address allocation method. Possible values include: + * 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private IPAllocationMethod publicIPAllocationMethod; + + /** + * The public IP address version. Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "properties.ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IPConfiguration ipConfiguration; + + /** + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "properties.dnsSettings") + private PublicIPAddressDnsSettings dnsSettings; + + /** + * The DDoS protection custom policy associated with the public IP address. + */ + @JsonProperty(value = "properties.ddosSettings") + private DdosSettings ddosSettings; + + /** + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The Public IP Prefix this Public IP Address should be allocated from. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIPPrefix; + + /** + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The resource GUID property of the public IP resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + 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 public IP address SKU. + * + * @return the sku value + */ + public PublicIPAddressSku sku() { + return this.sku; + } + + /** + * Set 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 public IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the publicIPAllocationMethod value + */ + public IPAllocationMethod publicIPAllocationMethod() { + return this.publicIPAllocationMethod; + } + + /** + * Set the public IP address allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param publicIPAllocationMethod the publicIPAllocationMethod value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.publicIPAllocationMethod = publicIPAllocationMethod; + return this; + } + + /** + * Get the public IP address version. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the IP configuration associated with the public IP address. + * + * @return the ipConfiguration value + */ + public IPConfiguration ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Get the FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value + */ + public PublicIPAddressDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the FQDN of the DNS record associated with the public IP address. + * + * @param dnsSettings the dnsSettings value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the DDoS protection custom policy associated with the public IP address. + * + * @return the ddosSettings value + */ + public DdosSettings ddosSettings() { + return this.ddosSettings; + } + + /** + * Set the DDoS protection custom policy associated with the public IP address. + * + * @param ddosSettings the ddosSettings value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withDdosSettings(DdosSettings ddosSettings) { + this.ddosSettings = ddosSettings; + return this; + } + + /** + * Get the list of tags associated with the public IP address. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP address. + * + * @param ipTags the ipTags value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the IP address associated with the public IP address resource. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address associated with the public IP address resource. + * + * @param ipAddress the ipAddress value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the Public IP Prefix this Public IP Address should be allocated from. + * + * @return the publicIPPrefix value + */ + public SubResource publicIPPrefix() { + return this.publicIPPrefix; + } + + /** + * Set the Public IP Prefix this Public IP Address should be allocated from. + * + * @param publicIPPrefix the publicIPPrefix value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPPrefix(SubResource publicIPPrefix) { + this.publicIPPrefix = publicIPPrefix; + return this; + } + + /** + * Get the idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the resource GUID property of the public IP resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get 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 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 resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesImpl.java new file mode 100644 index 0000000000000..7bcc1ce434b73 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesImpl.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddress; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPAddressesImpl extends GroupableResourcesCoreImpl implements PublicIPAddresses { + protected PublicIPAddressesImpl(NetworkManager manager) { + super(manager.inner().publicIPAddresses(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPAddressesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPAddressImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + PublicIPAddressesInner client = this.inner(); + return client.getVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected PublicIPAddressImpl wrapModel(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPAddressImpl wrapModel(String name) { + return new PublicIPAddressImpl(name, new PublicIPAddressInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesInner.java new file mode 100644 index 0000000000000..40f70d0d9d8e7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPAddressesInner.java @@ -0,0 +1,2085 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPAddresses. + */ +public class PublicIPAddressesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPAddressesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPAddressesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPAddressesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPAddressesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPAddresses to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPAddressesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + Observable> listVirtualMachineScaleSetPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + Observable> listVirtualMachineScaleSetVMPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses getVirtualMachineScaleSetPublicIPAddress" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}") + Observable> getVirtualMachineScaleSetPublicIPAddress(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpAddressName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpAddressName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpAddressName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * 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 subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * 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 subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * 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 subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); + } + + /** + * 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 subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP address tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP address tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The network interface name. + ServiceResponse> * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetPublicIPAddressDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixImpl.java new file mode 100644 index 0000000000000..b12043e8b3c0e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefix; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpTag; +import com.microsoft.azure.management.network.v2019_02_01.ReferencedPublicIpAddress; + +class PublicIPPrefixImpl extends GroupableResourceCoreImpl implements PublicIPPrefix, PublicIPPrefix.Definition, PublicIPPrefix.Update { + PublicIPPrefixImpl(String name, PublicIPPrefixInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPPrefixesInner client = this.manager().inner().publicIPPrefixes(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipPrefix() { + return this.inner().ipPrefix(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public Integer prefixLength() { + return this.inner().prefixLength(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List publicIPAddresses() { + return this.inner().publicIPAddresses(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPPrefixSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPPrefixImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPPrefixImpl withIpPrefix(String ipPrefix) { + this.inner().withIpPrefix(ipPrefix); + return this; + } + + @Override + public PublicIPPrefixImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPPrefixImpl withPrefixLength(Integer prefixLength) { + this.inner().withPrefixLength(prefixLength); + return this; + } + + @Override + public PublicIPPrefixImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddresses(List publicIPAddresses) { + this.inner().withPublicIPAddresses(publicIPAddresses); + return this; + } + + @Override + public PublicIPPrefixImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPPrefixImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPPrefixImpl withSku(PublicIPPrefixSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPPrefixImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixInner.java new file mode 100644 index 0000000000000..d421ca0db50de --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixInner.java @@ -0,0 +1,315 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixSku; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpTag; +import com.microsoft.azure.management.network.v2019_02_01.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP prefix resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPPrefixInner extends Resource { + /** + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIPPrefixSku sku; + + /** + * The public IP address version. Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The list of tags associated with the public IP prefix. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The Length of the Public IP Prefix. + */ + @JsonProperty(value = "properties.prefixLength") + private Integer prefixLength; + + /** + * The allocated Prefix. + */ + @JsonProperty(value = "properties.ipPrefix") + private String ipPrefix; + + /** + * The list of all referenced PublicIPAddresses. + */ + @JsonProperty(value = "properties.publicIPAddresses") + private List publicIPAddresses; + + /** + * The resource GUID property of the public IP prefix resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the Public IP prefix resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + 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 public IP prefix SKU. + * + * @return the sku value + */ + public PublicIPPrefixSku sku() { + return this.sku; + } + + /** + * Set 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 public IP address version. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the list of tags associated with the public IP prefix. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP prefix. + * + * @param ipTags the ipTags value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the Length of the Public IP Prefix. + * + * @return the prefixLength value + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the Length of the Public IP Prefix. + * + * @param prefixLength the prefixLength value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the allocated Prefix. + * + * @return the ipPrefix value + */ + public String ipPrefix() { + return this.ipPrefix; + } + + /** + * Set the allocated Prefix. + * + * @param ipPrefix the ipPrefix value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; + return this; + } + + /** + * Get the list of all referenced PublicIPAddresses. + * + * @return the publicIPAddresses value + */ + public List publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * Set the list of all referenced PublicIPAddresses. + * + * @param publicIPAddresses the publicIPAddresses value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withPublicIPAddresses(List publicIPAddresses) { + this.publicIPAddresses = publicIPAddresses; + return this; + } + + /** + * Get the resource GUID property of the public IP prefix resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP prefix resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get 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 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 resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPPrefixInner object itself. + */ + public PublicIPPrefixInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesImpl.java new file mode 100644 index 0000000000000..fc90bd007745b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefix; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPPrefixesImpl extends GroupableResourcesCoreImpl implements PublicIPPrefixes { + protected PublicIPPrefixesImpl(NetworkManager manager) { + super(manager.inner().publicIPPrefixes(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPPrefixesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPPrefixesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPPrefixesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPPrefixesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPPrefix call(PublicIPPrefixInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPPrefixImpl define(String name) { + return wrapModel(name); + } + + @Override + protected PublicIPPrefixImpl wrapModel(PublicIPPrefixInner inner) { + return new PublicIPPrefixImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPPrefixImpl wrapModel(String name) { + return new PublicIPPrefixImpl(name, new PublicIPPrefixInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesInner.java new file mode 100644 index 0000000000000..9fd8c3577a57f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/PublicIPPrefixesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PublicIPPrefixes. + */ +public class PublicIPPrefixesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPPrefixesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPPrefixesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPPrefixesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPPrefixesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPPrefixes to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPPrefixesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Body PublicIPPrefixInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpPrefixName") String publicIpPrefixName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.PublicIPPrefixes listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpPrefixName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpPrefixName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpPrefixName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpPrefixName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, expand).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner createOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP prefix tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @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 + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @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 + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP prefix tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @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 + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPPrefixInner object if successful. + */ + public PublicIPPrefixInner beginUpdateTags(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags), serviceCallback); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).map(new Func1, PublicIPPrefixInner>() { + @Override + public PublicIPPrefixInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPPrefixInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpPrefixName == null) { + throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPPrefixInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPPrefixInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP prefixes in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPPrefixInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterImpl.java new file mode 100644 index 0000000000000..cd24eb5335cb1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilter; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PatchRouteFilter; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilterRule; +import rx.functions.Func1; + +class RouteFilterImpl extends GroupableResourceCoreImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private PatchRouteFilter updateParameter; + RouteFilterImpl(String name, RouteFilterInner inner, NetworkManager manager) { + super(name, inner, manager); + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public Observable createResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List rules() { + List lst = new ArrayList(); + if (this.inner().rules() != null) { + for (RouteFilterRuleInner inner : this.inner().rules()) { + lst.add( new RouteFilterRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteFilterImpl withPeerings(List peerings) { + if (isInCreateMode()) { + this.inner().withPeerings(peerings); + } else { + this.updateParameter.withPeerings(peerings); + } + return this; + } + + @Override + public RouteFilterImpl withRules(List rules) { + if (isInCreateMode()) { + this.inner().withRules(rules); + } else { + this.updateParameter.withRules(rules); + } + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterInner.java new file mode 100644 index 0000000000000..750cf7706bc47 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterInner.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteFilterInner extends Resource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets 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 collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleImpl.java new file mode 100644 index 0000000000000..720a7ad812ecf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.RouteFilterRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PatchRouteFilterRule; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.Access; +import rx.functions.Func1; + +class RouteFilterRuleImpl extends CreatableUpdatableImpl implements RouteFilterRule, RouteFilterRule.Definition, RouteFilterRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeFilterName; + private String ruleName; + private PatchRouteFilterRule updateParameter; + + RouteFilterRuleImpl(String name, NetworkManager manager) { + super(name, new RouteFilterRuleInner()); + this.manager = manager; + // Set resource name + this.ruleName = name; + // + this.updateParameter = new PatchRouteFilterRule(); + } + + RouteFilterRuleImpl(RouteFilterRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeFilterName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilters"); + this.ruleName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilterRules"); + // + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.inner()) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.updateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.getAsync(this.resourceGroupName, this.routeFilterName, this.ruleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public List communities() { + return this.inner().communities(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String routeFilterRuleType() { + return this.inner().routeFilterRuleType(); + } + + @Override + public RouteFilterRuleImpl withExistingRouteFilter(String resourceGroupName, String routeFilterName) { + this.resourceGroupName = resourceGroupName; + this.routeFilterName = routeFilterName; + return this; + } + + @Override + public RouteFilterRuleImpl withAccess(Access access) { + this.inner().withAccess(access); + return this; + } + + @Override + public RouteFilterRuleImpl withCommunities(List communities) { + this.inner().withCommunities(communities); + return this; + } + + @Override + public RouteFilterRuleImpl withRouteFilterRuleType(String routeFilterRuleType) { + this.inner().withRouteFilterRuleType(routeFilterRuleType); + return this; + } + + @Override + public RouteFilterRuleImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public RouteFilterRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteFilterRuleImpl withId(String id) { + if (isInCreateMode()) { + this.inner().withId(id); + } else { + this.updateParameter.withId(id); + } + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleInner.java new file mode 100644 index 0000000000000..1d38553e54799 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRuleInner.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Access; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class RouteFilterRuleInner extends SubResource { + /** + * The access type of the rule. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of RouteFilterRuleInner class. + * @param access the access type of the rule. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public RouteFilterRuleInner() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get 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 collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesImpl.java new file mode 100644 index 0000000000000..ea243dd7b1c7a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilterRule; + +class RouteFilterRulesImpl extends WrapperImpl implements RouteFilterRules { + private final NetworkManager manager; + + RouteFilterRulesImpl(NetworkManager manager) { + super(manager.inner().routeFilterRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteFilterRuleImpl define(String name) { + return wrapModel(name); + } + + private RouteFilterRuleImpl wrapModel(RouteFilterRuleInner inner) { + return new RouteFilterRuleImpl(inner, manager()); + } + + private RouteFilterRuleImpl wrapModel(String name) { + return new RouteFilterRuleImpl(name, this.manager()); + } + + @Override + public Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + RouteFilterRulesInner client = this.inner(); + return client.listByRouteFilterAsync(resourceGroupName, routeFilterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeFilterName, ruleName) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeFilterName, ruleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesInner.java new file mode 100644 index 0000000000000..d4aef35274755 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFilterRulesInner.java @@ -0,0 +1,955 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.PatchRouteFilterRule; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilterRules. + */ +public class RouteFilterRulesInner { + /** The Retrofit service to perform REST calls. */ + private RouteFilterRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFilterRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFilterRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilterRules to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFilterRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules listByRouteFilter" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules") + Observable> listByRouteFilter(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilterRules listByRouteFilterNext" }) + @GET + Observable> listByRouteFilterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName, String ruleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteFilterRuleInner object + */ + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner createOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner update(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * 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 update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * 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 update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2019-02-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilter(final String resourceGroupName, final String routeFilterName) { + ServiceResponse> response = listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterWithServiceResponseAsync(resourceGroupName, routeFilterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterWithServiceResponseAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterSinglePageAsync(final String resourceGroupName, final String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByRouteFilter(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilterNext(final String nextPageLink) { + ServiceResponse> response = listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRouteFilterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterNextAsync(final String nextPageLink) { + return listByRouteFilterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterNextWithServiceResponseAsync(final String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersImpl.java new file mode 100644 index 0000000000000..b9ece2af9146e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilters; +import com.microsoft.azure.management.network.v2019_02_01.RouteFilter; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteFiltersImpl extends GroupableResourcesCoreImpl implements RouteFilters { + protected RouteFiltersImpl(NetworkManager manager) { + super(manager.inner().routeFilters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteFiltersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteFilterImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteFilterImpl wrapModel(RouteFilterInner inner) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteFilterImpl wrapModel(String name) { + return new RouteFilterImpl(name, new RouteFilterInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersInner.java new file mode 100644 index 0000000000000..711730e1e1e96 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteFiltersInner.java @@ -0,0 +1,1207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.PatchRouteFilter; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteFilters. + */ +public class RouteFiltersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteFiltersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFiltersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().last().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteFilterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner update(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * 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 update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * 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 update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2019-02-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteImpl.java new file mode 100644 index 0000000000000..d35f976e6dcca --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Route; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.RouteNextHopType; + +class RouteImpl extends CreatableUpdatableImpl implements Route, Route.Definition, Route.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeTableName; + private String routeName; + + RouteImpl(String name, NetworkManager manager) { + super(name, new RouteInner()); + this.manager = manager; + // Set resource name + this.routeName = name; + // + } + + RouteImpl(RouteInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.routeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); + this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.getAsync(this.resourceGroupName, this.routeTableName, this.routeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public RouteNextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + @Override + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.inner().withNextHopType(nextHopType); + return this; + } + + @Override + public RouteImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public RouteImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public RouteImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.inner().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + @Override + public RouteImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteInner.java new file mode 100644 index 0000000000000..a2190d3bed73c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route resource. + */ +@JsonFlatten +public class RouteInner extends SubResource { + /** + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The type of Azure hop the packet should be sent to. Possible values + * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + * 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "properties.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 = "properties.nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the destination CIDR to which the route applies. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set + * @return the RouteInner object itself. + */ + public RouteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get 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 IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteInner object itself. + */ + public RouteInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteInner object itself. + */ + public RouteInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableImpl.java new file mode 100644 index 0000000000000..22f67fc2fdfe2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.RouteTable; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.Route; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class RouteTableImpl extends GroupableResourceCoreImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + RouteTableImpl(String name, RouteTableInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableBgpRoutePropagation() { + return this.inner().disableBgpRoutePropagation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List routes() { + List lst = new ArrayList(); + if (this.inner().routes() != null) { + for (RouteInner inner : this.inner().routes()) { + lst.add( new RouteImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.inner().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + @Override + public RouteTableImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteTableImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public RouteTableImpl withRoutes(List routes) { + this.inner().withRoutes(routes); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableInner.java new file mode 100644 index 0000000000000..6fa5d46661240 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTableInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route table resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteTableInner extends Resource { + /** + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + */ + @JsonProperty(value = "properties.disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of routes contained within a route table. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set collection of routes contained within a route table. + * + * @param routes the routes value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get gets or sets 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 gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesImpl.java new file mode 100644 index 0000000000000..1f5734d853903 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.RouteTables; +import com.microsoft.azure.management.network.v2019_02_01.RouteTable; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteTablesImpl extends GroupableResourcesCoreImpl implements RouteTables { + protected RouteTablesImpl(NetworkManager manager) { + super(manager.inner().routeTables(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteTablesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteTablesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteTableImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteTableImpl wrapModel(RouteTableInner inner) { + return new RouteTableImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteTableImpl wrapModel(String name) { + return new RouteTableImpl(name, new RouteTableInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesInner.java new file mode 100644 index 0000000000000..0bb077af7969c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RouteTablesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RouteTables. + */ +public class RouteTablesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteTablesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteTablesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteTablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteTables to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteTablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.RouteTables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteTableInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route table tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route table tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesImpl.java new file mode 100644 index 0000000000000..2ac917f0dc134 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.Routes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.Route; + +class RoutesImpl extends WrapperImpl implements Routes { + private final NetworkManager manager; + + RoutesImpl(NetworkManager manager) { + super(manager.inner().routes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteImpl define(String name) { + return wrapModel(name); + } + + private RouteImpl wrapModel(RouteInner inner) { + return new RouteImpl(inner, manager()); + } + + private RouteImpl wrapModel(String name) { + return new RouteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String routeTableName) { + RoutesInner client = this.inner(); + return client.listAsync(resourceGroupName, routeTableName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeTableName, routeName) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeTableName, routeName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesInner.java new file mode 100644 index 0000000000000..df159acdf38b1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/RoutesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Routes. + */ +public class RoutesInner { + /** The Retrofit service to perform REST calls. */ + private RoutesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoutesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RoutesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Routes to be + * used by Retrofit to perform actually REST calls. + */ + interface RoutesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Routes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName, String routeName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName, String routeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteInner object + */ + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the RouteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the RouteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String routeTableName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String routeTableName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, routeTableName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String routeTableName) { + return listWithServiceResponseAsync(resourceGroupName, routeTableName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { + return listSinglePageAsync(resourceGroupName, routeTableName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultImpl.java new file mode 100644 index 0000000000000..4d34821a31765 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.SecurityGroupViewResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.SecurityGroupNetworkInterface; + +class SecurityGroupViewResultImpl extends WrapperImpl implements SecurityGroupViewResult { + private final NetworkManager manager; + SecurityGroupViewResultImpl(SecurityGroupViewResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List networkInterfaces() { + return this.inner().networkInterfaces(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultInner.java new file mode 100644 index 0000000000000..1595dde6d2844 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityGroupViewResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about security rules applied to the specified VM. + */ +public class SecurityGroupViewResultInner { + /** + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get list of network interfaces on the specified VM. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRuleInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRuleInner.java new file mode 100644 index 0000000000000..0fd298b1748d6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRuleInner.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRuleDirection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network security rule. + */ +@JsonFlatten +public class SecurityRuleInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', + * 'Icmp', 'Esp', and '*'. Possible values include: 'Tcp', 'Udp', 'Icmp', + * 'Esp', '*'. + */ + @JsonProperty(value = "properties.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 = "properties.sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.destinationPortRange") + private String destinationPortRange; + + /** + * The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "properties.sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "properties.sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The application security group specified as source. + */ + @JsonProperty(value = "properties.sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /** + * The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "properties.destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "properties.destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The application security group specified as destination. + */ + @JsonProperty(value = "properties.destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /** + * The source port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /** + * The network traffic is allowed or denied. Possible values include: + * 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.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 = "properties.priority") + private Integer priority; + + /** + * The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic. Possible values include: + * 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "properties.direction", required = true) + private SecurityRuleDirection direction; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network protocol this rule applies to. Possible values are 'Tcp', 'Udp', 'Icmp', 'Esp', and '*'. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*'. + * + * @return the protocol value + */ + public SecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set network protocol this rule applies to. Possible values are 'Tcp', 'Udp', 'Icmp', 'Esp', and '*'. Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', '*'. + * + * @param protocol the protocol value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get 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 source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the 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 destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the 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 CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the CIDR or source IP ranges. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value + */ + public List sourceApplicationSecurityGroups() { + return this.sourceApplicationSecurityGroups; + } + + /** + * Set the application security group specified as source. + * + * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + return this; + } + + /** + * Get the 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 destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. CIDR or destination IP ranges. + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value + */ + public List destinationApplicationSecurityGroups() { + return this.destinationApplicationSecurityGroups; + } + + /** + * Set the application security group specified as destination. + * + * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + return this; + } + + /** + * Get the source port ranges. + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority 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 of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @param priority the priority value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesImpl.java new file mode 100644 index 0000000000000..eefe2a3c4a5b4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.SecurityRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroupSecurityRule; + +class SecurityRulesImpl extends WrapperImpl implements SecurityRules { + private final NetworkManager manager; + + SecurityRulesImpl(NetworkManager manager) { + super(manager.inner().securityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl define(String name) { + return wrapModel(name); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleImpl(inner, manager()); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(String name) { + return new NetworkSecurityGroupSecurityRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + SecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesInner.java new file mode 100644 index 0000000000000..05b32fa9cc8c8 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SecurityRulesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SecurityRules. + */ +public class SecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private SecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface SecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.SecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SecurityRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesImpl.java new file mode 100644 index 0000000000000..dd124120bbdcd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicy; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ServiceEndpointPoliciesImpl extends GroupableResourcesCoreImpl implements ServiceEndpointPolicies { + protected ServiceEndpointPoliciesImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServiceEndpointPoliciesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServiceEndpointPoliciesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicy call(ServiceEndpointPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServiceEndpointPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(ServiceEndpointPolicyInner inner) { + return new ServiceEndpointPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected ServiceEndpointPolicyImpl wrapModel(String name) { + return new ServiceEndpointPolicyImpl(name, new ServiceEndpointPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesInner.java new file mode 100644 index 0000000000000..a9a78b7cd28c5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPoliciesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicies. + */ +public class ServiceEndpointPoliciesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicies listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates service Endpoint Policies. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner update(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().last().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.update(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates service Endpoint Policies. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @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 + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyInner object if successful. + */ + public ServiceEndpointPolicyInner beginUpdate(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).toBlocking().single().body(); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags), serviceCallback); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, tags).map(new Func1, ServiceEndpointPolicyInner>() { + @Override + public ServiceEndpointPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceEndpointPolicyInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdate(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..4da4684c5d2b1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinition; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; + +class ServiceEndpointPolicyDefinitionImpl extends CreatableUpdatableImpl implements ServiceEndpointPolicyDefinition, ServiceEndpointPolicyDefinition.Definition, ServiceEndpointPolicyDefinition.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String serviceEndpointPolicyName; + private String serviceEndpointPolicyDefinitionName; + + ServiceEndpointPolicyDefinitionImpl(String name, NetworkManager manager) { + super(name, new ServiceEndpointPolicyDefinitionInner()); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = name; + // + } + + ServiceEndpointPolicyDefinitionImpl(ServiceEndpointPolicyDefinitionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serviceEndpointPolicyDefinitionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serviceEndpointPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicies"); + this.serviceEndpointPolicyDefinitionName = IdParsingUtils.getValueFromIdByName(inner.id(), "serviceEndpointPolicyDefinitions"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPolicyDefinitionsInner client = this.manager().inner().serviceEndpointPolicyDefinitions(); + return client.getAsync(this.resourceGroupName, this.serviceEndpointPolicyName, this.serviceEndpointPolicyDefinitionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String service() { + return this.inner().service(); + } + + @Override + public List serviceResources() { + return this.inner().serviceResources(); + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName) { + this.resourceGroupName = resourceGroupName; + this.serviceEndpointPolicyName = serviceEndpointPolicyName; + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withService(String service) { + this.inner().withService(service); + return this; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl withServiceResources(List serviceResources) { + this.inner().withServiceResources(serviceResources); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionInner.java new file mode 100644 index 0000000000000..b0694328df134 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Service Endpoint policy definitions. + */ +@JsonFlatten +public class ServiceEndpointPolicyDefinitionInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Service endpoint name. + */ + @JsonProperty(value = "properties.service") + private String service; + + /** + * A list of service resources. + */ + @JsonProperty(value = "properties.serviceResources") + private List serviceResources; + + /** + * The provisioning state of the service end point policy definition. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get service endpoint name. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set service endpoint name. + * + * @param service the service value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of service resources. + * + * @return the serviceResources value + */ + public List serviceResources() { + return this.serviceResources; + } + + /** + * Set a list of service resources. + * + * @param serviceResources the serviceResources value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withServiceResources(List serviceResources) { + this.serviceResources = serviceResources; + return this; + } + + /** + * Get the provisioning state of the service end point policy definition. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java new file mode 100644 index 0000000000000..cc3da3598810c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinition; + +class ServiceEndpointPolicyDefinitionsImpl extends WrapperImpl implements ServiceEndpointPolicyDefinitions { + private final NetworkManager manager; + + ServiceEndpointPolicyDefinitionsImpl(NetworkManager manager) { + super(manager.inner().serviceEndpointPolicyDefinitions()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ServiceEndpointPolicyDefinitionImpl define(String name) { + return wrapModel(name); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(ServiceEndpointPolicyDefinitionInner inner) { + return new ServiceEndpointPolicyDefinitionImpl(inner, manager()); + } + + private ServiceEndpointPolicyDefinitionImpl wrapModel(String name) { + return new ServiceEndpointPolicyDefinitionImpl(name, this.manager()); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .map(new Func1() { + @Override + public ServiceEndpointPolicyDefinition call(ServiceEndpointPolicyDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsInner.java new file mode 100644 index 0000000000000..40a527e65d11f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyDefinitionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServiceEndpointPolicyDefinitions. + */ +public class ServiceEndpointPolicyDefinitionsInner { + /** The Retrofit service to perform REST calls. */ + private ServiceEndpointPolicyDefinitionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPolicyDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceEndpointPolicyDefinitionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ServiceEndpointPolicyDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceEndpointPolicyDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceEndpointPolicyDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceEndpointPolicyName") String serviceEndpointPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinitions listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner get(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable getAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner createOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceEndpointPolicyDefinitionInner object if successful. + */ + public ServiceEndpointPolicyDefinitionInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions), serviceCallback); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).map(new Func1, ServiceEndpointPolicyDefinitionInner>() { + @Override + public ServiceEndpointPolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ServiceEndpointPolicyDefinitionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitionName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (serviceEndpointPolicyDefinitions == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyDefinitions is required and cannot be null."); + } + Validator.validate(serviceEndpointPolicyDefinitions); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, this.client.subscriptionId(), serviceEndpointPolicyDefinitions, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String serviceEndpointPolicyName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + return listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String serviceEndpointPolicyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serviceEndpointPolicyName == null) { + throw new IllegalArgumentException("Parameter serviceEndpointPolicyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceEndpointPolicyDefinitionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceEndpointPolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyImpl.java new file mode 100644 index 0000000000000..c8c67903e1ca6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicy; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicyDefinition; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class ServiceEndpointPolicyImpl extends GroupableResourceCoreImpl implements ServiceEndpointPolicy, ServiceEndpointPolicy.Definition, ServiceEndpointPolicy.Update { + ServiceEndpointPolicyImpl(String name, ServiceEndpointPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServiceEndpointPoliciesInner client = this.manager().inner().serviceEndpointPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List serviceEndpointPolicyDefinitions() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicyDefinitions() != null) { + for (ServiceEndpointPolicyDefinitionInner inner : this.inner().serviceEndpointPolicyDefinitions()) { + lst.add( new ServiceEndpointPolicyDefinitionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ServiceEndpointPolicyImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ServiceEndpointPolicyImpl withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.inner().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyInner.java new file mode 100644 index 0000000000000..75fbe42f1af62 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ServiceEndpointPolicyInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service End point policy resource. + */ +@JsonFlatten +@SkipParentValidation +public class ServiceEndpointPolicyInner extends Resource { + /** + * A collection of service endpoint policy definitions of the service + * endpoint policy. + */ + @JsonProperty(value = "properties.serviceEndpointPolicyDefinitions") + private List serviceEndpointPolicyDefinitions; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the service endpoint policy resource. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the service endpoint policy. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of service endpoint policy definitions of the service endpoint policy. + * + * @return the serviceEndpointPolicyDefinitions value + */ + public List serviceEndpointPolicyDefinitions() { + return this.serviceEndpointPolicyDefinitions; + } + + /** + * Set a collection of service endpoint policy definitions of the service endpoint policy. + * + * @param serviceEndpointPolicyDefinitions the serviceEndpointPolicyDefinitions value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withServiceEndpointPolicyDefinitions(List serviceEndpointPolicyDefinitions) { + this.serviceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the service endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetImpl.java new file mode 100644 index 0000000000000..39df67c867360 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetImpl.java @@ -0,0 +1,288 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Subnet; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2019_02_01.IPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.IPConfigurationProfile; +import com.microsoft.azure.management.network.v2019_02_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2019_02_01.ServiceAssociationLink; +import com.microsoft.azure.management.network.v2019_02_01.Delegation; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.InterfaceEndpoint; +import com.microsoft.azure.management.network.v2019_02_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2019_02_01.RouteTable; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPolicy; + +class SubnetImpl extends CreatableUpdatableImpl implements Subnet, Subnet.Definition, Subnet.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String subnetName; + + SubnetImpl(String name, NetworkManager manager) { + super(name, new SubnetInner()); + this.manager = manager; + // Set resource name + this.subnetName = name; + // + } + + SubnetImpl(SubnetInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.subnetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public List addressPrefixes() { + return this.inner().addressPrefixes(); + } + + @Override + public List delegations() { + return this.inner().delegations(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List interfaceEndpoints() { + List lst = new ArrayList(); + if (this.inner().interfaceEndpoints() != null) { + for (InterfaceEndpointInner inner : this.inner().interfaceEndpoints()) { + lst.add( new InterfaceEndpointImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List ipConfigurationProfiles() { + return this.inner().ipConfigurationProfiles(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource natGateway() { + return this.inner().natGateway(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String purpose() { + return this.inner().purpose(); + } + + @Override + public List resourceNavigationLinks() { + return this.inner().resourceNavigationLinks(); + } + + @Override + public RouteTable routeTable() { + RouteTableInner inner = this.inner().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List serviceAssociationLinks() { + return this.inner().serviceAssociationLinks(); + } + + @Override + public List serviceEndpointPolicies() { + List lst = new ArrayList(); + if (this.inner().serviceEndpointPolicies() != null) { + for (ServiceEndpointPolicyInner inner : this.inner().serviceEndpointPolicies()) { + lst.add( new ServiceEndpointPolicyImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List serviceEndpoints() { + return this.inner().serviceEndpoints(); + } + + @Override + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public SubnetImpl withAddressPrefixes(List addressPrefixes) { + this.inner().withAddressPrefixes(addressPrefixes); + return this; + } + + @Override + public SubnetImpl withDelegations(List delegations) { + this.inner().withDelegations(delegations); + return this; + } + + @Override + public SubnetImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public SubnetImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public SubnetImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public SubnetImpl withNatGateway(SubResource natGateway) { + this.inner().withNatGateway(natGateway); + return this; + } + + @Override + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public SubnetImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public SubnetImpl withResourceNavigationLinks(List resourceNavigationLinks) { + this.inner().withResourceNavigationLinks(resourceNavigationLinks); + return this; + } + + @Override + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public SubnetImpl withServiceAssociationLinks(List serviceAssociationLinks) { + this.inner().withServiceAssociationLinks(serviceAssociationLinks); + return this; + } + + @Override + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.inner().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + @Override + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.inner().withServiceEndpoints(serviceEndpoints); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetInner.java new file mode 100644 index 0000000000000..497664f7c24a9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetInner.java @@ -0,0 +1,428 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2019_02_01.IPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.IPConfigurationProfile; +import com.microsoft.azure.management.network.v2019_02_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2019_02_01.ServiceAssociationLink; +import com.microsoft.azure.management.network.v2019_02_01.Delegation; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Subnet in a virtual network resource. + */ +@JsonFlatten +public class SubnetInner extends SubResource { + /** + * The address prefix for the subnet. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * List of address prefixes for the subnet. + */ + @JsonProperty(value = "properties.addressPrefixes") + private List addressPrefixes; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * The reference of the RouteTable resource. + */ + @JsonProperty(value = "properties.routeTable") + private RouteTableInner routeTable; + + /** + * Nat gateway associated with this subnet. + */ + @JsonProperty(value = "properties.natGateway") + private SubResource natGateway; + + /** + * An array of service endpoints. + */ + @JsonProperty(value = "properties.serviceEndpoints") + private List serviceEndpoints; + + /** + * An array of service endpoint policies. + */ + @JsonProperty(value = "properties.serviceEndpointPolicies") + private List serviceEndpointPolicies; + + /** + * An array of references to interface endpoints. + */ + @JsonProperty(value = "properties.interfaceEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List interfaceEndpoints; + + /** + * Gets an array of references to the network interface IP configurations + * using subnet. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /** + * Array of IP configuration profiles which reference this subnet. + */ + @JsonProperty(value = "properties.ipConfigurationProfiles", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurationProfiles; + + /** + * Gets an array of references to the external resources using subnet. + */ + @JsonProperty(value = "properties.resourceNavigationLinks") + private List resourceNavigationLinks; + + /** + * Gets an array of references to services injecting into this subnet. + */ + @JsonProperty(value = "properties.serviceAssociationLinks") + private List serviceAssociationLinks; + + /** + * Gets an array of references to the delegations on the subnet. + */ + @JsonProperty(value = "properties.delegations") + private List delegations; + + /** + * A read-only string identifying the intention of use for this subnet + * based on delegations and other user-defined properties. + */ + @JsonProperty(value = "properties.purpose", access = JsonProperty.Access.WRITE_ONLY) + private String purpose; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get the address prefix for the subnet. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get list of address prefixes for the subnet. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set list of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the reference of the RouteTable resource. + * + * @return the routeTable value + */ + public RouteTableInner routeTable() { + return this.routeTable; + } + + /** + * Set the reference of the RouteTable resource. + * + * @param routeTable the routeTable value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withRouteTable(RouteTableInner routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get nat gateway associated with this subnet. + * + * @return the natGateway value + */ + public SubResource natGateway() { + return this.natGateway; + } + + /** + * Set nat gateway associated with this subnet. + * + * @param natGateway the natGateway value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withNatGateway(SubResource natGateway) { + this.natGateway = natGateway; + return this; + } + + /** + * Get an array of service endpoints. + * + * @return the serviceEndpoints value + */ + public List serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set an array of service endpoints. + * + * @param serviceEndpoints the serviceEndpoints value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpoints(List serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Get an array of service endpoint policies. + * + * @return the serviceEndpointPolicies value + */ + public List serviceEndpointPolicies() { + return this.serviceEndpointPolicies; + } + + /** + * Set an array of service endpoint policies. + * + * @param serviceEndpointPolicies the serviceEndpointPolicies value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.serviceEndpointPolicies = serviceEndpointPolicies; + return this; + } + + /** + * Get an array of references to interface endpoints. + * + * @return the interfaceEndpoints value + */ + public List interfaceEndpoints() { + return this.interfaceEndpoints; + } + + /** + * Get gets an array of references to the network interface IP configurations using subnet. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value + */ + public List ipConfigurationProfiles() { + return this.ipConfigurationProfiles; + } + + /** + * Get gets an array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value + */ + public List resourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** + * Set gets an array of references to the external resources using subnet. + * + * @param resourceNavigationLinks the resourceNavigationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withResourceNavigationLinks(List resourceNavigationLinks) { + this.resourceNavigationLinks = resourceNavigationLinks; + return this; + } + + /** + * Get gets an array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value + */ + public List serviceAssociationLinks() { + return this.serviceAssociationLinks; + } + + /** + * Set gets an array of references to services injecting into this subnet. + * + * @param serviceAssociationLinks the serviceAssociationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceAssociationLinks(List serviceAssociationLinks) { + this.serviceAssociationLinks = serviceAssociationLinks; + return this; + } + + /** + * Get gets an array of references to the delegations on the subnet. + * + * @return the delegations value + */ + public List delegations() { + return this.delegations; + } + + /** + * Set gets an array of references to the delegations on the subnet. + * + * @param delegations the delegations value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withDelegations(List delegations) { + this.delegations = delegations; + return this; + } + + /** + * Get 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 provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsImpl.java new file mode 100644 index 0000000000000..10418e55a08fa --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.Subnets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.PrepareNetworkPoliciesRequest; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; + +class SubnetsImpl extends WrapperImpl implements Subnets { + private final NetworkManager manager; + + SubnetsImpl(NetworkManager manager) { + super(manager.inner().subnets()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public SubnetImpl define(String name) { + return wrapModel(name); + } + + private SubnetImpl wrapModel(SubnetInner inner) { + return new SubnetImpl(inner, manager()); + } + + private SubnetImpl wrapModel(String name) { + return new SubnetImpl(name, this.manager()); + } + + @Override + public Completable prepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + SubnetsInner client = this.inner(); + return client.prepareNetworkPoliciesAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + SubnetsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, subnetName) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsInner.java new file mode 100644 index 0000000000000..106ab5b20ae53 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/SubnetsInner.java @@ -0,0 +1,1047 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.PrepareNetworkPoliciesRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in Subnets. + */ +public class SubnetsInner { + /** The Retrofit service to perform REST calls. */ + private SubnetsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubnetsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SubnetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Subnets to be + * used by Retrofit to perform actually REST calls. + */ + interface SubnetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets prepareNetworkPolicies" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies") + Observable> prepareNetworkPolicies(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets beginPrepareNetworkPolicies" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies") + Observable> beginPrepareNetworkPolicies(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Subnets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the SubnetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void prepareNetworkPolicies(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + prepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture prepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(prepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable prepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return prepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> prepareNetworkPoliciesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (prepareNetworkPoliciesRequestParameters == null) { + throw new IllegalArgumentException("Parameter prepareNetworkPoliciesRequestParameters is required and cannot be null."); + } + Validator.validate(prepareNetworkPoliciesRequestParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.prepareNetworkPolicies(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), prepareNetworkPoliciesRequestParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPrepareNetworkPolicies(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + beginPrepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPrepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPrepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginPrepareNetworkPoliciesAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return beginPrepareNetworkPoliciesWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginPrepareNetworkPoliciesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (prepareNetworkPoliciesRequestParameters == null) { + throw new IllegalArgumentException("Parameter prepareNetworkPoliciesRequestParameters is required and cannot be null."); + } + Validator.validate(prepareNetworkPoliciesRequestParameters); + final String apiVersion = "2019-02-01"; + return service.beginPrepareNetworkPolicies(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), prepareNetworkPoliciesRequestParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPrepareNetworkPoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPrepareNetworkPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyImpl.java new file mode 100644 index 0000000000000..5b4db417e9288 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Topology; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TopologyResource; + +class TopologyImpl extends WrapperImpl implements Topology { + private final NetworkManager manager; + TopologyImpl(TopologyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime createdDateTime() { + return this.inner().createdDateTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List resources() { + return this.inner().resources(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyInner.java new file mode 100644 index 0000000000000..7e3f14337cd54 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TopologyInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TopologyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topology of the specified resource group. + */ +public class TopologyInner { + /** + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDateTime; + + /** + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A list of topology resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get gUID representing the operation id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value + */ + public DateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the datetime when the topology was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a list of topology resources. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultImpl.java new file mode 100644 index 0000000000000..894cf4d5cb23f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingDetails; + +class TroubleshootingResultImpl extends WrapperImpl implements TroubleshootingResult { + private final NetworkManager manager; + TroubleshootingResultImpl(TroubleshootingResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String code() { + return this.inner().code(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List results() { + return this.inner().results(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultInner.java new file mode 100644 index 0000000000000..8b20b321bcfa5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/TroubleshootingResultInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Troubleshooting information gained from specified resource. + */ +public class TroubleshootingResultInner { + /** + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the start time of the troubleshooting. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the troubleshooting. + * + * @param startTime the startTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the troubleshooting. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the troubleshooting. + * + * @param endTime the endTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the result code of the troubleshooting. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set 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 information from troubleshooting. + * + * @return the results value + */ + public List results() { + return this.results; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..948e27cecb424 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.UsageName; + +class UsageImpl extends WrapperImpl implements Usage { + private final NetworkManager manager; + + UsageImpl(UsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public long currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public long limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..410dad8c32196 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsageInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes network resource usage. + */ +public class UsageInner { + /** + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /** + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /** + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Creates an instance of UsageInner class. + * @param currentValue the current value of the usage. + * @param limit the limit of usage. + * @param name the name of the type of usage. + */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get an enum describing the unit of measurement. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set an enum describing the unit of measurement. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set 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 of usage. + * + * @return the limit value + */ + public long limit() { + return this.limit; + } + + /** + * Set 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 of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..4def8fe7abe82 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final NetworkManager manager; + + UsagesImpl(NetworkManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesInner.java new file mode 100644 index 0000000000000..1b842ee6feeb6 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/UsagesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + Observable> list(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultImpl.java new file mode 100644 index 0000000000000..5fdbb9778ae05 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VerificationIPFlowResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.Access; + +class VerificationIPFlowResultImpl extends WrapperImpl implements VerificationIPFlowResult { + private final NetworkManager manager; + VerificationIPFlowResultImpl(VerificationIPFlowResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public String ruleName() { + return this.inner().ruleName(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultInner.java new file mode 100644 index 0000000000000..44f04f883a3f5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VerificationIPFlowResultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.Access; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of IP flow verification on the target resource. + */ +public class VerificationIPFlowResultInner { + /** + * Indicates whether the traffic is allowed or denied. Possible values + * include: 'Allow', 'Deny'. + */ + @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 indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..1716ccdfab36d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHub; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubRouteTable; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.HubVirtualNetworkConnection; + +class VirtualHubImpl extends GroupableResourceCoreImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + VirtualHubImpl(String name, VirtualHubInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteGateway() { + return this.inner().expressRouteGateway(); + } + + @Override + public SubResource p2SVpnGateway() { + return this.inner().p2SVpnGateway(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public VirtualHubRouteTable routeTable() { + return this.inner().routeTable(); + } + + @Override + public List virtualNetworkConnections() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkConnections() != null) { + for (HubVirtualNetworkConnectionInner inner : this.inner().virtualNetworkConnections()) { + lst.add( new HubVirtualNetworkConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public SubResource vpnGateway() { + return this.inner().vpnGateway(); + } + + @Override + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public VirtualHubImpl withExpressRouteGateway(SubResource expressRouteGateway) { + this.inner().withExpressRouteGateway(expressRouteGateway); + return this; + } + + @Override + public VirtualHubImpl withP2SVpnGateway(SubResource p2SVpnGateway) { + this.inner().withP2SVpnGateway(p2SVpnGateway); + return this; + } + + @Override + public VirtualHubImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualHubImpl withRouteTable(VirtualHubRouteTable routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public VirtualHubImpl withVirtualNetworkConnections(List virtualNetworkConnections) { + this.inner().withVirtualNetworkConnections(virtualNetworkConnections); + return this; + } + + @Override + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + + @Override + public VirtualHubImpl withVpnGateway(SubResource vpnGateway) { + this.inner().withVpnGateway(vpnGateway); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubInner.java new file mode 100644 index 0000000000000..3a5872ba0a9fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubInner.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubRouteTable; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualHubInner extends Resource { + /** + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * The VpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.vpnGateway") + private SubResource vpnGateway; + + /** + * The P2SVpnGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.p2SVpnGateway") + private SubResource p2SVpnGateway; + + /** + * The expressRouteGateway associated with this VirtualHub. + */ + @JsonProperty(value = "properties.expressRouteGateway") + private SubResource expressRouteGateway; + + /** + * List of all vnet connections with this VirtualHub. + */ + @JsonProperty(value = "properties.virtualNetworkConnections") + private List virtualNetworkConnections; + + /** + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The routeTable associated with this virtual hub. + */ + @JsonProperty(value = "properties.routeTable") + private VirtualHubRouteTable routeTable; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets 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 VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the VirtualHub belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the VpnGateway associated with this VirtualHub. + * + * @return the vpnGateway value + */ + public SubResource vpnGateway() { + return this.vpnGateway; + } + + /** + * Set the VpnGateway associated with this VirtualHub. + * + * @param vpnGateway the vpnGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVpnGateway(SubResource vpnGateway) { + this.vpnGateway = vpnGateway; + return this; + } + + /** + * Get the P2SVpnGateway associated with this VirtualHub. + * + * @return the p2SVpnGateway value + */ + public SubResource p2SVpnGateway() { + return this.p2SVpnGateway; + } + + /** + * Set the P2SVpnGateway associated with this VirtualHub. + * + * @param p2SVpnGateway the p2SVpnGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withP2SVpnGateway(SubResource p2SVpnGateway) { + this.p2SVpnGateway = p2SVpnGateway; + return this; + } + + /** + * Get the expressRouteGateway associated with this VirtualHub. + * + * @return the expressRouteGateway value + */ + public SubResource expressRouteGateway() { + return this.expressRouteGateway; + } + + /** + * Set the expressRouteGateway associated with this VirtualHub. + * + * @param expressRouteGateway the expressRouteGateway value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withExpressRouteGateway(SubResource expressRouteGateway) { + this.expressRouteGateway = expressRouteGateway; + return this; + } + + /** + * Get list of all vnet connections with this VirtualHub. + * + * @return the virtualNetworkConnections value + */ + public List virtualNetworkConnections() { + return this.virtualNetworkConnections; + } + + /** + * Set list of all vnet connections with this VirtualHub. + * + * @param virtualNetworkConnections the virtualNetworkConnections value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualNetworkConnections(List virtualNetworkConnections) { + this.virtualNetworkConnections = virtualNetworkConnections; + return this; + } + + /** + * Get address-prefix for this VirtualHub. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set address-prefix for this VirtualHub. + * + * @param addressPrefix the addressPrefix value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the routeTable associated with this virtual hub. + * + * @return the routeTable value + */ + public VirtualHubRouteTable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable associated with this virtual hub. + * + * @param routeTable the routeTable value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withRouteTable(VirtualHubRouteTable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsImpl.java new file mode 100644 index 0000000000000..eb78f769a256c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHubs; +import com.microsoft.azure.management.network.v2019_02_01.VirtualHub; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualHubsImpl extends GroupableResourcesCoreImpl implements VirtualHubs { + protected VirtualHubsImpl(NetworkManager manager) { + super(manager.inner().virtualHubs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualHubsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualHubImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualHubImpl wrapModel(VirtualHubInner inner) { + return new VirtualHubImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualHubImpl wrapModel(String name) { + return new VirtualHubImpl(name, new VirtualHubInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsInner.java new file mode 100644 index 0000000000000..793eacacd1e96 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualHubsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualHubs. + */ +public class VirtualHubsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualHubsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualHubsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualHubInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualHubInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualHubInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualHubInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VirtualHub tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VirtualHub tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualHubName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualHubName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualHubName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualHubInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 0000000000000..435696fd30928 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2019_02_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2019_02_01.InboundNatRule; +import com.microsoft.azure.management.network.v2019_02_01.IPVersion; +import com.microsoft.azure.management.network.v2019_02_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2019_02_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTap; + +class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements VirtualMachineScaleSetNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualMachineScaleSetName; + private String virtualmachineIndex; + private String networkInterfaceName; + private String ipConfigurationName; + + VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(this.resourceGroupName, this.virtualMachineScaleSetName, this.virtualmachineIndex, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List virtualNetworkTaps() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkTaps() != null) { + for (VirtualNetworkTapInner inner : this.inner().virtualNetworkTaps()) { + lst.add( new VirtualNetworkTapImpl(inner.name(), inner, manager())); + } + } + return lst; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..bb0fc6f4a09c2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2019_02_01.LocalNetworkGateway; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateway; + +class VirtualNetworkGatewayConnectionImpl extends GroupableResourceCoreImpl implements VirtualNetworkGatewayConnection, VirtualNetworkGatewayConnection.Definition, VirtualNetworkGatewayConnection.Update { + VirtualNetworkGatewayConnectionImpl(String name, VirtualNetworkGatewayConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.inner().connectionProtocol(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public LocalNetworkGateway localNetworkGateway2() { + LocalNetworkGatewayInner inner = this.inner().localNetworkGateway2(); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway1() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway1(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway2() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway2(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.inner().withConnectionType(connectionType); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.inner().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.inner().withConnectionProtocol(connectionProtocol); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.inner().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.inner().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.inner().withPeer(peer); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.inner().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.inner().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionInner.java new file mode 100644 index 0000000000000..5e4622cb6558e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,526 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /** + * Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', + * 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual Network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the connectionProtocol value + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param connectionProtocol the connectionProtocol value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 0000000000000..49dce0c1774be --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionStatus; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionType; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.SubResource; +import java.util.Map; +import com.microsoft.azure.management.network.v2019_02_01.TunnelConnectionHealth; + +class VirtualNetworkGatewayConnectionListEntityImpl extends WrapperImpl implements VirtualNetworkGatewayConnectionListEntity { + private final NetworkManager manager; + + VirtualNetworkGatewayConnectionListEntityImpl(VirtualNetworkGatewayConnectionListEntityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.inner().connectionProtocol(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean expressRouteGatewayBypass() { + return this.inner().expressRouteGatewayBypass(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.inner().localNetworkGateway2(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.inner().virtualNetworkGateway1(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.inner().virtualNetworkGateway2(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java new file mode 100644 index 0000000000000..dc7381615b0c5 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,527 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /** + * Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', + * 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.connectionProtocol") + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual Network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Bypass ExpressRoute Gateway for data forwarding. + */ + @JsonProperty(value = "properties.expressRouteGatewayBypass") + private Boolean expressRouteGatewayBypass; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2(VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2(VirtualNetworkConnectionGatewayReference localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the connectionProtocol value + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.connectionProtocol; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param connectionProtocol the connectionProtocol value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.connectionProtocol = connectionProtocol; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual Network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value + */ + public Boolean expressRouteGatewayBypass() { + return this.expressRouteGatewayBypass; + } + + /** + * Set bypass ExpressRoute Gateway for data forwarding. + * + * @param expressRouteGatewayBypass the expressRouteGatewayBypass value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsImpl.java new file mode 100644 index 0000000000000..077d898084f7c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionSharedKey; +import com.microsoft.azure.management.network.v2019_02_01.ConnectionResetSharedKey; + +class VirtualNetworkGatewayConnectionsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGatewayConnections { + protected VirtualNetworkGatewayConnectionsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGatewayConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnection call(VirtualNetworkGatewayConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength) + .map(new Func1() { + @Override + public ConnectionResetSharedKey call(ConnectionResetSharedKeyInner inner) { + return new ConnectionResetSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(VirtualNetworkGatewayConnectionInner inner) { + return new VirtualNetworkGatewayConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, new VirtualNetworkGatewayConnectionInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsInner.java new file mode 100644 index 0000000000000..2ae7937706495 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionsInner.java @@ -0,0 +1,1489 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGatewayConnections. + */ +public class VirtualNetworkGatewayConnectionsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewayConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewayConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewayConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGatewayConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewayConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections setSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> setSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections beginSetSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> beginSetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections getSharedKey" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> getSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections resetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> resetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections beginResetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> beginResetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); + } + + /** + * 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 tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().single().body(); + } + + /** + * 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 tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> getSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + Observable> observable = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single().body(); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + return service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..610343affe3e3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateway; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2019_02_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; + +class VirtualNetworkGatewayImpl extends GroupableResourceCoreImpl implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + VirtualNetworkGatewayImpl(String name, VirtualNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean activeActive() { + return this.inner().activeActive(); + } + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public AddressSpace customRoutes() { + return this.inner().customRoutes(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource gatewayDefaultSite() { + return this.inner().gatewayDefaultSite(); + } + + @Override + public VirtualNetworkGatewayType gatewayType() { + return this.inner().gatewayType(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public VpnClientConfiguration vpnClientConfiguration() { + return this.inner().vpnClientConfiguration(); + } + + @Override + public VpnType vpnType() { + return this.inner().vpnType(); + } + + @Override + public VirtualNetworkGatewayImpl withActiveActive(Boolean activeActive) { + this.inner().withActiveActive(activeActive); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withCustomRoutes(AddressSpace customRoutes) { + this.inner().withCustomRoutes(customRoutes); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.inner().withGatewayDefaultSite(gatewayDefaultSite); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.inner().withGatewayType(gatewayType); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.inner().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.inner().withVpnType(vpnType); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayInner.java new file mode 100644 index 0000000000000..3328210f77f65 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayInner.java @@ -0,0 +1,395 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2019_02_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayInner extends Resource { + /** + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The type of this virtual network gateway. Possible values are: 'Vpn' and + * 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + */ + @JsonProperty(value = "properties.gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /** + * The type of this virtual network gateway. Possible values are: + * 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', + * 'RouteBased'. + */ + @JsonProperty(value = "properties.vpnType") + private VpnType vpnType; + + /** + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean activeActive; + + /** + * The reference of the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of + * removing existing default site setting. + */ + @JsonProperty(value = "properties.gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /** + * The reference of the VirtualNetworkGatewaySku resource which represents + * the SKU selected for Virtual network gateway. + */ + @JsonProperty(value = "properties.sku") + private VirtualNetworkGatewaySku sku; + + /** + * The reference of the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + */ + @JsonProperty(value = "properties.vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /** + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The reference of the address space resource which represents the custom + * routes address space specified by the the customer for virtual network + * gateway and VpnClient. + */ + @JsonProperty(value = "properties.customRoutes") + private AddressSpace customRoutes; + + /** + * The resource GUID property of the VirtualNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get iP configurations for virtual network gateway. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configurations for virtual network gateway. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @return the gatewayType value + */ + public VirtualNetworkGatewayType gatewayType() { + return this.gatewayType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @param gatewayType the gatewayType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.gatewayType = gatewayType; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @return the vpnType value + */ + public VpnType vpnType() { + return this.vpnType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @param vpnType the vpnType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { + this.vpnType = vpnType; + return this; + } + + /** + * Get whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set whether BGP is enabled for this virtual network gateway or not. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get activeActive flag. + * + * @return the activeActive value + */ + public Boolean activeActive() { + return this.activeActive; + } + + /** + * Set activeActive flag. + * + * @param activeActive the activeActive value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActiveActive(Boolean activeActive) { + this.activeActive = activeActive; + return this; + } + + /** + * Get the reference of 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 reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @param gatewayDefaultSite the gatewayDefaultSite value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.gatewayDefaultSite = gatewayDefaultSite; + return this; + } + + /** + * Get the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @return the sku value + */ + public VirtualNetworkGatewaySku sku() { + return this.sku; + } + + /** + * Set the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @param sku the sku value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value + */ + public VpnClientConfiguration vpnClientConfiguration() { + return this.vpnClientConfiguration; + } + + /** + * Set the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @param vpnClientConfiguration the vpnClientConfiguration value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set virtual network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the reference of the address space resource which represents the custom routes address space specified by the the customer for virtual network gateway and VpnClient. + * + * @return the customRoutes value + */ + public AddressSpace customRoutes() { + return this.customRoutes; + } + + /** + * Set the reference of the address space resource which represents the custom routes address space specified by the the customer for virtual network gateway and VpnClient. + * + * @param customRoutes the customRoutes value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withCustomRoutes(AddressSpace customRoutes) { + this.customRoutes = customRoutes; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysImpl.java new file mode 100644 index 0000000000000..6e47d1e0c909c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.BgpPeerStatusListResult; +import com.microsoft.azure.management.network.v2019_02_01.GatewayRouteListResult; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientIPsecParameters; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.management.network.v2019_02_01.VpnDeviceScriptParameters; + +class VirtualNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGateways { + protected VirtualNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); + } + + @Override + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + ;} + + @Override + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { + return new BgpPeerStatusListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName) + ;} + + @Override + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(String name) { + return new VirtualNetworkGatewayImpl(name, new VirtualNetworkGatewayInner(), this.manager()); + } + + private VirtualNetworkGatewayConnectionListEntityImpl wrapVirtualNetworkGatewayConnectionListEntityModel(VirtualNetworkGatewayConnectionListEntityInner inner) { + return new VirtualNetworkGatewayConnectionListEntityImpl(inner, manager()); + } + + @Override + public Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConnectionListEntityInner inner) { + return wrapVirtualNetworkGatewayConnectionListEntityModel(inner); + } + }); + } + + @Override + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + ;} + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysInner.java new file mode 100644 index 0000000000000..215ec9e9e97d7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewaysInner.java @@ -0,0 +1,3286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.management.network.v2019_02_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2019_02_01.VpnDeviceScriptParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGateways. + */ +public class VirtualNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways listConnections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + Observable> listConnections(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> reset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways resetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> resetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginResetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> beginResetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways generatevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginGetVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> beginGetVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> getBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginGetBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> beginGetBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways supportedVpnDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + Observable> supportedVpnDevices(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> getLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginGetLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> beginGetLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> getAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginGetAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> beginGetAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways setVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> setVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginSetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> beginSetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways getVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> getVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways beginGetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> beginGetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways vpnDeviceConfigurationScript" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + Observable> vpnDeviceConfigurationScript(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VpnDeviceScriptParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGateways listConnectionsNext" }) + @GET + Observable> listConnectionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnections(final String resourceGroupName, final String virtualNetworkGatewayName) { + ServiceResponse> response = listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsSinglePageAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listConnections(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String gatewayVip = null; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String gatewayVip = null; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> resetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetVpnClientSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetVpnClientSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = generatevpnclientpackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse generatevpnclientpackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = generateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGetVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable> beginGetVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnProfilePackageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnProfilePackageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String peer = null; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String peer = null; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * 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 + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetBgpPeerStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable> supportedVpnDevicesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedVpnDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedVpnDevicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetLearnedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetLearnedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * 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 + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAdvertisedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAdvertisedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner setVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> setVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2019-02-01"; + Observable> observable = service.setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginSetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2019-02-01"; + return service.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> getVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginGetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the String object + */ + public Observable> vpnDeviceConfigurationScriptWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = vpnDeviceConfigurationScriptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse vpnDeviceConfigurationScriptDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnectionsNext(final String nextPageLink) { + ServiceResponse> response = listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listConnectionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsNextAsync(final String nextPageLink) { + return listConnectionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsNextWithServiceResponseAsync(final String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listConnectionsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..e963e7b8c35b3 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetwork; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.Subnet; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeering; + +class VirtualNetworkImpl extends GroupableResourceCoreImpl implements VirtualNetwork, VirtualNetwork.Definition, VirtualNetwork.Update { + VirtualNetworkImpl(String name, VirtualNetworkInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public SubResource ddosProtectionPlan() { + return this.inner().ddosProtectionPlan(); + } + + @Override + public DhcpOptions dhcpOptions() { + return this.inner().dhcpOptions(); + } + + @Override + public Boolean enableDdosProtection() { + return this.inner().enableDdosProtection(); + } + + @Override + public Boolean enableVmProtection() { + return this.inner().enableVmProtection(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List virtualNetworkPeerings() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkPeerings() != null) { + for (VirtualNetworkPeeringInner inner : this.inner().virtualNetworkPeerings()) { + lst.add( new VirtualNetworkPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.inner().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + @Override + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.inner().withDhcpOptions(dhcpOptions); + return this; + } + + @Override + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.inner().withEnableDdosProtection(enableDdosProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.inner().withEnableVmProtection(enableVmProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkImpl withSubnets(List subnets) { + this.inner().withSubnets(subnets); + return this; + } + + @Override + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.inner().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkInner.java new file mode 100644 index 0000000000000..4262444132f19 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkInner extends Resource { + /** + * The AddressSpace that contains an array of IP address ranges that can be + * used by subnets. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The dhcpOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "properties.dhcpOptions") + private DhcpOptions dhcpOptions; + + /** + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "properties.subnets") + private List subnets; + + /** + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "properties.virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /** + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated + * with the resource. + */ + @JsonProperty(value = "properties.enableDdosProtection") + private Boolean enableDdosProtection; + + /** + * Indicates if VM protection is enabled for all the subnets in the virtual + * network. + */ + @JsonProperty(value = "properties.enableVmProtection") + private Boolean enableVmProtection; + + /** + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "properties.ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get 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 that contains an array of IP address ranges that can be used by subnets. + * + * @param addressSpace the addressSpace value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dhcpOptions 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 that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @param dhcpOptions the dhcpOptions value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get a list of subnets in a Virtual Network. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Set a list of subnets in a Virtual Network. + * + * @param subnets the subnets value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get a list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value + */ + public List virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * Set a list of peerings in a Virtual Network. + * + * @param virtualNetworkPeerings the virtualNetworkPeerings value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.virtualNetworkPeerings = virtualNetworkPeerings; + return this; + } + + /** + * Get the resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resourceGuid property of the Virtual Network resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @param enableDdosProtection the enableDdosProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get 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 indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @param enableVmProtection the enableVmProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { + this.enableVmProtection = enableVmProtection; + return this; + } + + /** + * Get the DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the DDoS protection plan associated with the virtual network. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringImpl.java new file mode 100644 index 0000000000000..74a3638fd1e95 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeeringState; + +class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String virtualNetworkPeeringName; + + VirtualNetworkPeeringImpl(String name, NetworkManager manager) { + super(name, new VirtualNetworkPeeringInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = name; + // + } + + VirtualNetworkPeeringImpl(VirtualNetworkPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkPeerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowForwardedTraffic() { + return this.inner().allowForwardedTraffic(); + } + + @Override + public Boolean allowGatewayTransit() { + return this.inner().allowGatewayTransit(); + } + + @Override + public Boolean allowVirtualNetworkAccess() { + return this.inner().allowVirtualNetworkAccess(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkPeeringState peeringState() { + return this.inner().peeringState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AddressSpace remoteAddressSpace() { + return this.inner().remoteAddressSpace(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Boolean useRemoteGateways() { + return this.inner().useRemoteGateways(); + } + + @Override + public VirtualNetworkPeeringImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.inner().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.inner().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.inner().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.inner().withPeeringState(peeringState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.inner().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.inner().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.inner().withUseRemoteGateways(useRemoteGateways); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringInner.java new file mode 100644 index 0000000000000..b856feddad27c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Peerings in a virtual network resource. + */ +@JsonFlatten +public class VirtualNetworkPeeringInner extends SubResource { + /** + * Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + */ + @JsonProperty(value = "properties.allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /** + * Whether the forwarded traffic from the VMs in the local virtual network + * will be allowed/disallowed in remote virtual network. + */ + @JsonProperty(value = "properties.allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /** + * If gateway links can be used in remote virtual networking to link to + * this virtual network. + */ + @JsonProperty(value = "properties.allowGatewayTransit") + private Boolean allowGatewayTransit; + + /** + * If remote gateways can be used on this virtual network. If the flag is + * set to true, and allowGatewayTransit on remote peering is also true, + * virtual network will use gateways of remote virtual network for transit. + * Only one peering can have this flag set to true. This flag cannot be set + * if virtual network already has a gateway. + */ + @JsonProperty(value = "properties.useRemoteGateways") + private Boolean useRemoteGateways; + + /** + * The reference of the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register + * for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * The reference of the remote virtual network address space. + */ + @JsonProperty(value = "properties.remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /** + * The status of the virtual network peering. Possible values are + * 'Initiated', 'Connected', and 'Disconnected'. Possible values include: + * 'Initiated', 'Connected', 'Disconnected'. + */ + @JsonProperty(value = "properties.peeringState") + private VirtualNetworkPeeringState peeringState; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * 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") + private String etag; + + /** + * Get 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 whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. + * + * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; + return this; + } + + /** + * Get 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 whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. + * + * @param allowForwardedTraffic the allowForwardedTraffic value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.allowForwardedTraffic = allowForwardedTraffic; + return this; + } + + /** + * Get 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 if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @param allowGatewayTransit the allowGatewayTransit value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.allowGatewayTransit = allowGatewayTransit; + return this; + } + + /** + * Get 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 if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @param useRemoteGateways the useRemoteGateways value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { + this.useRemoteGateways = useRemoteGateways; + return this; + } + + /** + * Get the reference of 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 reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the reference of the remote virtual network address space. + * + * @return the remoteAddressSpace value + */ + public AddressSpace remoteAddressSpace() { + return this.remoteAddressSpace; + } + + /** + * Set the reference of the remote virtual network address space. + * + * @param remoteAddressSpace the remoteAddressSpace value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.remoteAddressSpace = remoteAddressSpace; + return this; + } + + /** + * Get the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @return the peeringState value + */ + public VirtualNetworkPeeringState peeringState() { + return this.peeringState; + } + + /** + * Set the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @param peeringState the peeringState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { + this.peeringState = peeringState; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsImpl.java new file mode 100644 index 0000000000000..e1c4587f99e7b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeering; + +class VirtualNetworkPeeringsImpl extends WrapperImpl implements VirtualNetworkPeerings { + private final NetworkManager manager; + + VirtualNetworkPeeringsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkPeeringImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkPeeringImpl wrapModel(VirtualNetworkPeeringInner inner) { + return new VirtualNetworkPeeringImpl(inner, manager()); + } + + private VirtualNetworkPeeringImpl wrapModel(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsInner.java new file mode 100644 index 0000000000000..1066ee3267788 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkPeerings. + */ +public class VirtualNetworkPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapImpl.java new file mode 100644 index 0000000000000..523180ee2e031 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTap; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2019_02_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.NetworkInterfaceTapConfiguration; + +class VirtualNetworkTapImpl extends GroupableResourceCoreImpl implements VirtualNetworkTap, VirtualNetworkTap.Definition, VirtualNetworkTap.Update { + VirtualNetworkTapImpl(String name, VirtualNetworkTapInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkTapsInner client = this.manager().inner().virtualNetworkTaps(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FrontendIPConfiguration destinationLoadBalancerFrontEndIPConfiguration() { + FrontendIPConfigurationInner inner = this.inner().destinationLoadBalancerFrontEndIPConfiguration(); + if (inner != null) { + return new FrontendIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration destinationNetworkInterfaceIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().destinationNetworkInterfaceIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer destinationPort() { + return this.inner().destinationPort(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaceTapConfigurations() { + List lst = new ArrayList(); + if (this.inner().networkInterfaceTapConfigurations() != null) { + for (NetworkInterfaceTapConfigurationInner inner : this.inner().networkInterfaceTapConfigurations()) { + lst.add( new NetworkInterfaceTapConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkTapImpl withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration) { + this.inner().withDestinationLoadBalancerFrontEndIPConfiguration(destinationLoadBalancerFrontEndIPConfiguration); + return this; + } + + @Override + public VirtualNetworkTapImpl withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration) { + this.inner().withDestinationNetworkInterfaceIPConfiguration(destinationNetworkInterfaceIPConfiguration); + return this; + } + + @Override + public VirtualNetworkTapImpl withDestinationPort(Integer destinationPort) { + this.inner().withDestinationPort(destinationPort); + return this; + } + + @Override + public VirtualNetworkTapImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapInner.java new file mode 100644 index 0000000000000..0a56910b5d3d0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapInner.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network Tap resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkTapInner extends Resource { + /** + * Specifies the list of resource IDs for the network interface IP + * configuration that needs to be tapped. + */ + @JsonProperty(value = "properties.networkInterfaceTapConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaceTapConfigurations; + + /** + * The resourceGuid property of the virtual network tap. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the virtual network tap. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The reference to the private IP Address of the collector nic that will + * receive the tap. + */ + @JsonProperty(value = "properties.destinationNetworkInterfaceIPConfiguration") + private NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration; + + /** + * The reference to the private IP address on the internal Load Balancer + * that will receive the tap. + */ + @JsonProperty(value = "properties.destinationLoadBalancerFrontEndIPConfiguration") + private FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration; + + /** + * The VXLAN destination port that will receive the tapped traffic. + */ + @JsonProperty(value = "properties.destinationPort") + private Integer destinationPort; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get 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 of the virtual network tap. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the virtual network tap. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 reference to the private IP Address of the collector nic that will receive the tap. + * + * @param destinationNetworkInterfaceIPConfiguration the destinationNetworkInterfaceIPConfiguration value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner destinationNetworkInterfaceIPConfiguration) { + this.destinationNetworkInterfaceIPConfiguration = destinationNetworkInterfaceIPConfiguration; + return this; + } + + /** + * Get the 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 reference to the private IP address on the internal Load Balancer that will receive the tap. + * + * @param destinationLoadBalancerFrontEndIPConfiguration the destinationLoadBalancerFrontEndIPConfiguration value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationLoadBalancerFrontEndIPConfiguration(FrontendIPConfigurationInner destinationLoadBalancerFrontEndIPConfiguration) { + this.destinationLoadBalancerFrontEndIPConfiguration = destinationLoadBalancerFrontEndIPConfiguration; + return this; + } + + /** + * Get the VXLAN destination port that will receive the tapped traffic. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the VXLAN destination port that will receive the tapped traffic. + * + * @param destinationPort the destinationPort value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsImpl.java new file mode 100644 index 0000000000000..68b34415ae9ea --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTap; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualNetworkTapsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkTaps { + protected VirtualNetworkTapsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkTaps(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkTapsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkTapsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkTapsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkTapsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkTap call(VirtualNetworkTapInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworkTapsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworkTapsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkTap call(VirtualNetworkTapInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkTapImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualNetworkTapImpl wrapModel(VirtualNetworkTapInner inner) { + return new VirtualNetworkTapImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkTapImpl wrapModel(String name) { + return new VirtualNetworkTapImpl(name, new VirtualNetworkTapInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsInner.java new file mode 100644 index 0000000000000..eb57f9552a781 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkTapsInner.java @@ -0,0 +1,1273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkTaps. + */ +public class VirtualNetworkTapsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkTapsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkTapsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkTapsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkTapsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkTaps to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkTapsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkTapInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkTapInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject tapParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("tapName") String tapName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject tapParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkTaps listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String tapName) { + deleteWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String tapName) { + return deleteWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String tapName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String tapName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String tapName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, tapName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginCreateOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, tapName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().last().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String tapName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).toBlocking().last().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String tapName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String tapName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String tapName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String tapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String tapName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String tapName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkTapInner object if successful. + */ + public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).toBlocking().single().body(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String tapName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags), serviceCallback); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String tapName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName, tags).map(new Func1, VirtualNetworkTapInner>() { + @Override + public VirtualNetworkTapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkTapInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String tapName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (tapName == null) { + throw new IllegalArgumentException("Parameter tapName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject tapParameters = new TagsObject(); + tapParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, tapName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), tapParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkTapInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkTapInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkTapInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..7b548b5937cdd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkUsageName; + +class VirtualNetworkUsageImpl extends WrapperImpl implements VirtualNetworkUsage { + private final NetworkManager manager; + + VirtualNetworkUsageImpl(VirtualNetworkUsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public VirtualNetworkUsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageInner.java new file mode 100644 index 0000000000000..a372032e12570 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkUsageInner.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage details for subnet. + */ +public class VirtualNetworkUsageInner { + /** + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /** + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /** + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get indicates number of IPs used from the Subnet. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get subnet identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get indicates the size of the subnet. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name containing common and localized value for usage. + * + * @return the name value + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get usage units. Returns 'Count'. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..b4e2b2694104e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetwork; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.IPAddressAvailabilityResult; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkUsage; + +class VirtualNetworksImpl extends GroupableResourcesCoreImpl implements VirtualNetworks { + protected VirtualNetworksImpl(NetworkManager manager) { + super(manager.inner().virtualNetworks(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworksInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + VirtualNetworksInner client = this.inner(); + return client.checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress) + .map(new Func1() { + @Override + public IPAddressAvailabilityResult call(IPAddressAvailabilityResultInner inner) { + return new IPAddressAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkImpl wrapModel(VirtualNetworkInner inner) { + return new VirtualNetworkImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkImpl wrapModel(String name) { + return new VirtualNetworkImpl(name, new VirtualNetworkInner(), this.manager()); + } + + private VirtualNetworkUsageImpl wrapVirtualNetworkUsageModel(VirtualNetworkUsageInner inner) { + return new VirtualNetworkUsageImpl(inner, manager()); + } + + @Override + public Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.listUsageAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkUsage call(VirtualNetworkUsageInner inner) { + return wrapVirtualNetworkUsageModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksInner.java new file mode 100644 index 0000000000000..313ebb4eac547 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworksInner.java @@ -0,0 +1,1690 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworks. + */ +public class VirtualNetworksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks checkIPAddressAvailability" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + Observable> checkIPAddressAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("ipAddress") String ipAddress, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks listUsage" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages") + Observable> listUsage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualNetworks listUsageNext" }) + @GET + Observable> listUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network tags. + * + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + } + + /** + * 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 + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (ipAddress == null) { + throw new IllegalArgumentException("Parameter ipAddress is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkIPAddressAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsage(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listUsageSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listUsage(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsageNext(final String nextPageLink) { + ServiceResponse> response = listUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageNextAsync(final String nextPageLink) { + return listUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANImpl.java new file mode 100644 index 0000000000000..924134ab5d4fe --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualWAN; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.OfficeTrafficCategory; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.P2SVpnServerConfiguration; + +class VirtualWANImpl extends GroupableResourceCoreImpl implements VirtualWAN, VirtualWAN.Definition, VirtualWAN.Update { + VirtualWANImpl(String name, VirtualWANInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualWansInner client = this.manager().inner().virtualWans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowBranchToBranchTraffic() { + return this.inner().allowBranchToBranchTraffic(); + } + + @Override + public Boolean allowVnetToVnetTraffic() { + return this.inner().allowVnetToVnetTraffic(); + } + + @Override + public Boolean disableVpnEncryption() { + return this.inner().disableVpnEncryption(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.inner().office365LocalBreakoutCategory(); + } + + @Override + public List p2SVpnServerConfigurations() { + List lst = new ArrayList(); + if (this.inner().p2SVpnServerConfigurations() != null) { + for (P2SVpnServerConfigurationInner inner : this.inner().p2SVpnServerConfigurations()) { + lst.add( new P2SVpnServerConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String securityProviderName() { + return this.inner().securityProviderName(); + } + + @Override + public List virtualHubs() { + return this.inner().virtualHubs(); + } + + @Override + public List vpnSites() { + return this.inner().vpnSites(); + } + + @Override + public VirtualWANImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.inner().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + @Override + public VirtualWANImpl withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.inner().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); + return this; + } + + @Override + public VirtualWANImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.inner().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + @Override + public VirtualWANImpl withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory) { + this.inner().withOffice365LocalBreakoutCategory(office365LocalBreakoutCategory); + return this; + } + + @Override + public VirtualWANImpl withP2SVpnServerConfigurations(List p2SVpnServerConfigurations) { + this.inner().withP2SVpnServerConfigurations(p2SVpnServerConfigurations); + return this; + } + + @Override + public VirtualWANImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualWANImpl withSecurityProviderName(String securityProviderName) { + this.inner().withSecurityProviderName(securityProviderName); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANInner.java new file mode 100644 index 0000000000000..0fc15c6a2ba39 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWANInner.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.OfficeTrafficCategory; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualWAN Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualWANInner extends Resource { + /** + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "properties.disableVpnEncryption") + private Boolean disableVpnEncryption; + + /** + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "properties.virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /** + * List of VpnSites in the VirtualWAN. + */ + @JsonProperty(value = "properties.vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /** + * The Security Provider name. + */ + @JsonProperty(value = "properties.securityProviderName") + private String securityProviderName; + + /** + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "properties.allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /** + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "properties.allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /** + * The office local breakout category. Possible values include: 'Optimize', + * 'OptimizeAndAllow', 'All', 'None'. + */ + @JsonProperty(value = "properties.office365LocalBreakoutCategory") + private OfficeTrafficCategory office365LocalBreakoutCategory; + + /** + * List of all P2SVpnServerConfigurations associated with the virtual wan. + */ + @JsonProperty(value = "properties.p2SVpnServerConfigurations") + private List p2SVpnServerConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets 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 vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value + */ + public Boolean disableVpnEncryption() { + return this.disableVpnEncryption; + } + + /** + * Set vpn encryption to be disabled or not. + * + * @param disableVpnEncryption the disableVpnEncryption value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.disableVpnEncryption = disableVpnEncryption; + return this; + } + + /** + * Get list of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value + */ + public List virtualHubs() { + return this.virtualHubs; + } + + /** + * Get list of VpnSites in the VirtualWAN. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Get the Security Provider name. + * + * @return the securityProviderName value + */ + public String securityProviderName() { + return this.securityProviderName; + } + + /** + * Set the Security Provider name. + * + * @param securityProviderName the securityProviderName value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withSecurityProviderName(String securityProviderName) { + this.securityProviderName = securityProviderName; + return this; + } + + /** + * Get true if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set true if branch to branch traffic is allowed. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get true if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value + */ + public Boolean allowVnetToVnetTraffic() { + return this.allowVnetToVnetTraffic; + } + + /** + * Set true if Vnet to Vnet traffic is allowed. + * + * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; + return this; + } + + /** + * Get the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None'. + * + * @return the office365LocalBreakoutCategory value + */ + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.office365LocalBreakoutCategory; + } + + /** + * Set the office local breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', 'All', 'None'. + * + * @param office365LocalBreakoutCategory the office365LocalBreakoutCategory value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withOffice365LocalBreakoutCategory(OfficeTrafficCategory office365LocalBreakoutCategory) { + this.office365LocalBreakoutCategory = office365LocalBreakoutCategory; + return this; + } + + /** + * Get list of all P2SVpnServerConfigurations associated with the virtual wan. + * + * @return the p2SVpnServerConfigurations value + */ + public List p2SVpnServerConfigurations() { + return this.p2SVpnServerConfigurations; + } + + /** + * Set list of all P2SVpnServerConfigurations associated with the virtual wan. + * + * @param p2SVpnServerConfigurations the p2SVpnServerConfigurations value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withP2SVpnServerConfigurations(List p2SVpnServerConfigurations) { + this.p2SVpnServerConfigurations = p2SVpnServerConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWanSecurityProvidersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWanSecurityProvidersInner.java new file mode 100644 index 0000000000000..c6032da8709d9 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWanSecurityProvidersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.VirtualWanSecurityProvider; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Collection of SecurityProviders. + */ +public class VirtualWanSecurityProvidersInner { + /** + * List of VirtualWAN security providers. + */ + @JsonProperty(value = "supportedProviders") + private List supportedProviders; + + /** + * Get list of VirtualWAN security providers. + * + * @return the supportedProviders value + */ + public List supportedProviders() { + return this.supportedProviders; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansImpl.java new file mode 100644 index 0000000000000..cb9646b099902 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VirtualWans; +import com.microsoft.azure.management.network.v2019_02_01.VirtualWAN; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualWansImpl extends GroupableResourcesCoreImpl implements VirtualWans { + protected VirtualWansImpl(NetworkManager manager) { + super(manager.inner().virtualWans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualWansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualWansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualWansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualWansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualWansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualWansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualWANImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualWANImpl wrapModel(VirtualWANInner inner) { + return new VirtualWANImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualWANImpl wrapModel(String name) { + return new VirtualWANImpl(name, new VirtualWANInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansInner.java new file mode 100644 index 0000000000000..482955d274e08 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualWansInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualWans. + */ +public class VirtualWansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualWansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualWansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualWansService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualWans to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualWansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VirtualWans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualWANInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualWANInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, virtualWANName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner createOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginCreateOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualWANInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualWANInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualWANName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWANName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWANName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWANName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualWANInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..01a54b7db7abf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VpnClientIPsecParameters; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.DhGroup; +import com.microsoft.azure.management.network.v2019_02_01.IkeEncryption; +import com.microsoft.azure.management.network.v2019_02_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2019_02_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2019_02_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2019_02_01.PfsGroup; + +class VpnClientIPsecParametersImpl extends WrapperImpl implements VpnClientIPsecParameters { + private final NetworkManager manager; + VpnClientIPsecParametersImpl(VpnClientIPsecParametersInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DhGroup dhGroup() { + return this.inner().dhGroup(); + } + + @Override + public IkeEncryption ikeEncryption() { + return this.inner().ikeEncryption(); + } + + @Override + public IkeIntegrity ikeIntegrity() { + return this.inner().ikeIntegrity(); + } + + @Override + public IpsecEncryption ipsecEncryption() { + return this.inner().ipsecEncryption(); + } + + @Override + public IpsecIntegrity ipsecIntegrity() { + return this.inner().ipsecIntegrity(); + } + + @Override + public PfsGroup pfsGroup() { + return this.inner().pfsGroup(); + } + + @Override + public int saDataSizeKilobytes() { + return this.inner().saDataSizeKilobytes(); + } + + @Override + public int saLifeTimeSeconds() { + return this.inner().saLifeTimeSeconds(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersInner.java new file mode 100644 index 0000000000000..49fa46110bd6a --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnClientIPsecParametersInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2019_02_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2019_02_01.IkeEncryption; +import com.microsoft.azure.management.network.v2019_02_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2019_02_01.DhGroup; +import com.microsoft.azure.management.network.v2019_02_01.PfsGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + */ +public class VpnClientIPsecParametersInner { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Group used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Group used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get 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 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 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 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 IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..fd7e8e1bb6fbf --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionImpl.java @@ -0,0 +1,254 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VpnConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnectionStatus; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; + +class VpnConnectionImpl extends CreatableUpdatableImpl implements VpnConnection, VpnConnection.Definition, VpnConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String gatewayName; + private String connectionName; + + VpnConnectionImpl(String name, NetworkManager manager) { + super(name, new VpnConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + VpnConnectionImpl(VpnConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.gatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.getAsync(this.resourceGroupName, this.gatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer connectionBandwidth() { + return this.inner().connectionBandwidth(); + } + + @Override + public VpnConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public Boolean enableInternetSecurity() { + return this.inner().enableInternetSecurity(); + } + + @Override + public Boolean enableRateLimiting() { + return this.inner().enableRateLimiting(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVpnSite() { + return this.inner().remoteVpnSite(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Boolean useLocalAzureIpAddress() { + return this.inner().useLocalAzureIpAddress(); + } + + @Override + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.inner().vpnConnectionProtocolType(); + } + + @Override + public VpnConnectionImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + @Override + public VpnConnectionImpl withConnectionBandwidth(Integer connectionBandwidth) { + this.inner().withConnectionBandwidth(connectionBandwidth); + return this; + } + + @Override + public VpnConnectionImpl withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.inner().withConnectionStatus(connectionStatus); + return this; + } + + @Override + public VpnConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VpnConnectionImpl withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.inner().withEnableInternetSecurity(enableInternetSecurity); + return this; + } + + @Override + public VpnConnectionImpl withEnableRateLimiting(Boolean enableRateLimiting) { + this.inner().withEnableRateLimiting(enableRateLimiting); + return this; + } + + @Override + public VpnConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VpnConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VpnConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VpnConnectionImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnConnectionImpl withRemoteVpnSite(SubResource remoteVpnSite) { + this.inner().withRemoteVpnSite(remoteVpnSite); + return this; + } + + @Override + public VpnConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VpnConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VpnConnectionImpl withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.inner().withUseLocalAzureIpAddress(useLocalAzureIpAddress); + return this; + } + + @Override + public VpnConnectionImpl withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.inner().withVpnConnectionProtocolType(vpnConnectionProtocolType); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionInner.java new file mode 100644 index 0000000000000..a7d68374de636 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionInner.java @@ -0,0 +1,413 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnectionStatus; +import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkGatewayConnectionProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * VpnConnection Resource. + */ +@JsonFlatten +public class VpnConnectionInner extends SubResource { + /** + * Id of the connected vpn site. + */ + @JsonProperty(value = "properties.remoteVpnSite") + private SubResource remoteVpnSite; + + /** + * Routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The connection status. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus") + private VpnConnectionStatus connectionStatus; + + /** + * Connection protocol used for this connection. Possible values include: + * 'IKEv2', 'IKEv1'. + */ + @JsonProperty(value = "properties.vpnConnectionProtocolType") + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /** + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidth") + private Integer connectionBandwidth; + + /** + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableRateLimiting") + private Boolean enableRateLimiting; + + /** + * Enable internet security. + */ + @JsonProperty(value = "properties.enableInternetSecurity") + private Boolean enableInternetSecurity; + + /** + * Use local azure ip to initiate connection. + */ + @JsonProperty(value = "properties.useLocalAzureIpAddress") + private Boolean useLocalAzureIpAddress; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * 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; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get id of the connected vpn site. + * + * @return the remoteVpnSite value + */ + public SubResource remoteVpnSite() { + return this.remoteVpnSite; + } + + /** + * Set id of the connected vpn site. + * + * @param remoteVpnSite the remoteVpnSite value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { + this.remoteVpnSite = remoteVpnSite; + return this; + } + + /** + * Get routing weight for vpn connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Set the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @param connectionStatus the connectionStatus value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.connectionStatus = connectionStatus; + return this; + } + + /** + * Get connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @return the vpnConnectionProtocolType value + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.vpnConnectionProtocolType; + } + + /** + * Set connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1'. + * + * @param vpnConnectionProtocolType the vpnConnectionProtocolType value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType) { + this.vpnConnectionProtocolType = vpnConnectionProtocolType; + return this; + } + + /** + * Get ingress bytes transferred. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get egress bytes transferred. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get expected bandwidth in MBPS. + * + * @return the connectionBandwidth value + */ + public Integer connectionBandwidth() { + return this.connectionBandwidth; + } + + /** + * Set expected bandwidth in MBPS. + * + * @param connectionBandwidth the connectionBandwidth value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionBandwidth(Integer connectionBandwidth) { + this.connectionBandwidth = connectionBandwidth; + return this; + } + + /** + * Get sharedKey for the vpn connection. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set sharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableRateLimiting value + */ + public Boolean enableRateLimiting() { + return this.enableRateLimiting; + } + + /** + * Set enableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + this.enableRateLimiting = enableRateLimiting; + return this; + } + + /** + * Get enable internet security. + * + * @return the enableInternetSecurity value + */ + public Boolean enableInternetSecurity() { + return this.enableInternetSecurity; + } + + /** + * Set enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value + */ + public Boolean useLocalAzureIpAddress() { + return this.useLocalAzureIpAddress; + } + + /** + * Set use local azure ip to initiate connection. + * + * @param useLocalAzureIpAddress the useLocalAzureIpAddress value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.useLocalAzureIpAddress = useLocalAzureIpAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get 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 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 gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsImpl.java new file mode 100644 index 0000000000000..6701bad96e9a2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnection; + +class VpnConnectionsImpl extends WrapperImpl implements VpnConnections { + private final NetworkManager manager; + + VpnConnectionsImpl(NetworkManager manager) { + super(manager.inner().vpnConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VpnConnectionImpl define(String name) { + return wrapModel(name); + } + + private VpnConnectionImpl wrapModel(VpnConnectionInner inner) { + return new VpnConnectionImpl(inner, manager()); + } + + private VpnConnectionImpl wrapModel(String name) { + return new VpnConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + VpnConnectionsInner client = this.inner(); + return client.listByVpnGatewayAsync(resourceGroupName, gatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, gatewayName, connectionName) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, gatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsInner.java new file mode 100644 index 0000000000000..22869e759220e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnConnectionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnConnections. + */ +public class VpnConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private VpnConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections listByVpnGateway" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") + Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnConnections listByVpnGatewayNext" }) + @GET + Observable> listByVpnGatewayNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGateway(final String resourceGroupName, final String gatewayName) { + ServiceResponse> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + ServiceResponse> * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGatewayNext(final String nextPageLink) { + ServiceResponse> response = listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewayNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayNextAsync(final String nextPageLink) { + return listByVpnGatewayNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayNextWithServiceResponseAsync(final String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewayNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVpnGatewayNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..3662732b9b85d --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.VpnConnection; + +class VpnGatewayImpl extends GroupableResourceCoreImpl implements VpnGateway, VpnGateway.Definition, VpnGateway.Update { + VpnGatewayImpl(String name, VpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (VpnConnectionInner inner : this.inner().connections()) { + lst.add( new VpnConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public Integer vpnGatewayScaleUnit() { + return this.inner().vpnGatewayScaleUnit(); + } + + @Override + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VpnGatewayImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public VpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + + @Override + public VpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.inner().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayInner.java new file mode 100644 index 0000000000000..1ed28549fc4ca --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewayInner.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * List of all vpn connections to the gateway. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The scale unit for this vpn gateway. + */ + @JsonProperty(value = "properties.vpnGatewayScaleUnit") + private Integer vpnGatewayScaleUnit; + + /** + * Gets 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 VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get list of all vpn connections to the gateway. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set list of all vpn connections to the gateway. + * + * @param connections the connections value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the scale unit for this vpn gateway. + * + * @return the vpnGatewayScaleUnit value + */ + public Integer vpnGatewayScaleUnit() { + return this.vpnGatewayScaleUnit; + } + + /** + * Set the scale unit for this vpn gateway. + * + * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.vpnGatewayScaleUnit = vpnGatewayScaleUnit; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysImpl.java new file mode 100644 index 0000000000000..a71925be89fa7 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnGateways; +import com.microsoft.azure.management.network.v2019_02_01.VpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnGatewaysImpl extends GroupableResourcesCoreImpl implements VpnGateways { + protected VpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().vpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnGatewayImpl wrapModel(VpnGatewayInner inner) { + return new VpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnGatewayImpl wrapModel(String name) { + return new VpnGatewayImpl(name, new VpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysInner.java new file mode 100644 index 0000000000000..2b38250cce84f --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnGatewaysInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnGateways. + */ +public class VpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseImpl.java new file mode 100644 index 0000000000000..116b5e9b482eb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.VpnProfileResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class VpnProfileResponseImpl extends WrapperImpl implements VpnProfileResponse { + private final NetworkManager manager; + VpnProfileResponseImpl(VpnProfileResponseInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String profileUrl() { + return this.inner().profileUrl(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseInner.java new file mode 100644 index 0000000000000..988baf82e3bf4 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnProfileResponseInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Profile Response for package generation. + */ +public class VpnProfileResponseInner { + /** + * URL to the VPN profile. + */ + @JsonProperty(value = "profileUrl") + private String profileUrl; + + /** + * Get uRL to the VPN profile. + * + * @return the profileUrl value + */ + public String profileUrl() { + return this.profileUrl; + } + + /** + * Set 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; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..e50d6438f540b --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteImpl.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnSite; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.DeviceProperties; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; + +class VpnSiteImpl extends GroupableResourceCoreImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + VpnSiteImpl(String name, VpnSiteInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public BgpSettings bgpProperties() { + return this.inner().bgpProperties(); + } + + @Override + public DeviceProperties deviceProperties() { + return this.inner().deviceProperties(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public Boolean isSecuritySite() { + return this.inner().isSecuritySite(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String siteKey() { + return this.inner().siteKey(); + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.inner().withBgpProperties(bgpProperties); + return this; + } + + @Override + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.inner().withDeviceProperties(deviceProperties); + return this; + } + + @Override + public VpnSiteImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public VpnSiteImpl withIsSecuritySite(Boolean isSecuritySite) { + this.inner().withIsSecuritySite(isSecuritySite); + return this; + } + + @Override + public VpnSiteImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnSiteImpl withSiteKey(String siteKey) { + this.inner().withSiteKey(siteKey); + return this; + } + + @Override + public VpnSiteImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteInner.java new file mode 100644 index 0000000000000..5335a680bc3f1 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSiteInner.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2019_02_01.DeviceProperties; +import com.microsoft.azure.management.network.v2019_02_01.AddressSpace; +import com.microsoft.azure.management.network.v2019_02_01.BgpSettings; +import com.microsoft.azure.management.network.v2019_02_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnSite Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnSiteInner extends Resource { + /** + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * The device properties. + */ + @JsonProperty(value = "properties.deviceProperties") + private DeviceProperties deviceProperties; + + /** + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "properties.siteKey") + private String siteKey; + + /** + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private BgpSettings bgpProperties; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * IsSecuritySite flag. + */ + @JsonProperty(value = "properties.isSecuritySite") + private Boolean isSecuritySite; + + /** + * Gets 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 VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the vpnSite belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get the device properties. + * + * @return the deviceProperties value + */ + public DeviceProperties deviceProperties() { + return this.deviceProperties; + } + + /** + * Set the device properties. + * + * @param deviceProperties the deviceProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { + this.deviceProperties = deviceProperties; + return this; + } + + /** + * Get the ip-address for the vpn-site. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ip-address for the vpn-site. + * + * @param ipAddress the ipAddress value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the key for vpn-site that can be used for connections. + * + * @return the siteKey value + */ + public String siteKey() { + return this.siteKey; + } + + /** + * Set the key for vpn-site that can be used for connections. + * + * @param siteKey the siteKey value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withSiteKey(String siteKey) { + this.siteKey = siteKey; + return this; + } + + /** + * Get the AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges. + * + * @param addressSpace the addressSpace value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the set of bgp properties. + * + * @return the bgpProperties value + */ + public BgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get isSecuritySite flag. + * + * @return the isSecuritySite value + */ + public Boolean isSecuritySite() { + return this.isSecuritySite; + } + + /** + * Set isSecuritySite flag. + * + * @param isSecuritySite the isSecuritySite value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIsSecuritySite(Boolean isSecuritySite) { + this.isSecuritySite = isSecuritySite; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsImpl.java new file mode 100644 index 0000000000000..a40c24965b9bb --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnSitesConfigurations; +import rx.Completable; +import com.microsoft.azure.management.network.v2019_02_01.GetVpnSitesConfigurationRequest; + +class VpnSitesConfigurationsImpl extends WrapperImpl implements VpnSitesConfigurations { + private final NetworkManager manager; + + VpnSitesConfigurationsImpl(NetworkManager manager) { + super(manager.inner().vpnSitesConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + VpnSitesConfigurationsInner client = this.inner(); + return client.downloadAsync(resourceGroupName, virtualWANName, request).toCompletable(); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsInner.java new file mode 100644 index 0000000000000..6800d2a64ecb2 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesConfigurationsInner.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.GetVpnSitesConfigurationRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSitesConfigurations. + */ +public class VpnSitesConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private VpnSitesConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSitesConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSitesConfigurations download" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> download(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSitesConfigurations beginDownload" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> beginDownload(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void download(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> downloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2019-02-01"; + Observable> observable = service.download(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDownload(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDownloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2019-02-01"; + return service.beginDownload(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDownloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDownloadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesImpl.java new file mode 100644 index 0000000000000..baa1c38f787ad --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.VpnSites; +import com.microsoft.azure.management.network.v2019_02_01.VpnSite; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnSitesImpl extends GroupableResourcesCoreImpl implements VpnSites { + protected VpnSitesImpl(NetworkManager manager) { + super(manager.inner().vpnSites(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnSitesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnSitesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnSiteImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnSiteImpl wrapModel(VpnSiteInner inner) { + return new VpnSiteImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnSiteImpl wrapModel(String name) { + return new VpnSiteImpl(name, new VpnSiteInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesInner.java new file mode 100644 index 0000000000000..e43a2df78d5a0 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VpnSitesInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_02_01.ErrorException; +import com.microsoft.azure.management.network.v2019_02_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSites. + */ +public class VpnSitesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnSitesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSites to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.VpnSites listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnSiteInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnSiteInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2019-02-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VpnSiteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VpnSiteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2019-02-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-02-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vpnSiteName) { + deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vpnSiteName) { + return deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vpnSiteName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vpnSiteName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * 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 ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VpnSiteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesImpl.java new file mode 100644 index 0000000000000..1a503839ada3e --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicy; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class WebApplicationFirewallPoliciesImpl extends GroupableResourcesCoreImpl implements WebApplicationFirewallPolicies { + protected WebApplicationFirewallPoliciesImpl(NetworkManager manager) { + super(manager.inner().webApplicationFirewallPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebApplicationFirewallPolicy call(WebApplicationFirewallPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WebApplicationFirewallPoliciesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebApplicationFirewallPolicy call(WebApplicationFirewallPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WebApplicationFirewallPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected WebApplicationFirewallPolicyImpl wrapModel(WebApplicationFirewallPolicyInner inner) { + return new WebApplicationFirewallPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected WebApplicationFirewallPolicyImpl wrapModel(String name) { + return new WebApplicationFirewallPolicyImpl(name, new WebApplicationFirewallPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesInner.java new file mode 100644 index 0000000000000..404f6114397fd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPoliciesInner.java @@ -0,0 +1,869 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in WebApplicationFirewallPolicies. + */ +public class WebApplicationFirewallPoliciesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WebApplicationFirewallPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebApplicationFirewallPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebApplicationFirewallPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(WebApplicationFirewallPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for WebApplicationFirewallPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface WebApplicationFirewallPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @Path("subscriptionId") String subscriptionId, @Body WebApplicationFirewallPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebApplicationFirewallPolicyInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the protection policies within a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebApplicationFirewallPolicyInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebApplicationFirewallPolicyInner object if successful. + */ + public WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * 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 + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String policyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, WebApplicationFirewallPolicyInner>() { + @Override + public WebApplicationFirewallPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.getByResourceGroup(resourceGroupName, policyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebApplicationFirewallPolicyInner object if successful. + */ + public WebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters).map(new Func1, WebApplicationFirewallPolicyInner>() { + @Override + public WebApplicationFirewallPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-02-01"; + return service.createOrUpdate(resourceGroupName, policyName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String policyName) { + deleteWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().last().body(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String policyName) { + return deleteWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + Observable> observable = service.delete(resourceGroupName, policyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String policyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String policyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-02-01"; + return service.beginDelete(resourceGroupName, policyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebApplicationFirewallPolicyInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the protection policies within a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebApplicationFirewallPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the WAF policies in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyImpl.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..60169e854a995 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicy; +import rx.Observable; +import com.microsoft.azure.management.network.v2019_02_01.PolicySettings; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallCustomRule; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicyResourceState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2019_02_01.ApplicationGateway; + +class WebApplicationFirewallPolicyImpl extends GroupableResourceCoreImpl implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update { + WebApplicationFirewallPolicyImpl(String name, WebApplicationFirewallPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationGateways() { + List lst = new ArrayList(); + if (this.inner().applicationGateways() != null) { + for (ApplicationGatewayInner inner : this.inner().applicationGateways()) { + lst.add( new ApplicationGatewayImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List customRules() { + return this.inner().customRules(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public PolicySettings policySettings() { + return this.inner().policySettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public WebApplicationFirewallPolicyImpl withCustomRules(List customRules) { + this.inner().withCustomRules(customRules); + return this; + } + + @Override + public WebApplicationFirewallPolicyImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public WebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.inner().withPolicySettings(policySettings); + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyInner.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyInner.java new file mode 100644 index 0000000000000..87d19aee54686 --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/WebApplicationFirewallPolicyInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2019_02_01.implementation; + +import com.microsoft.azure.management.network.v2019_02_01.PolicySettings; +import java.util.List; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallCustomRule; +import com.microsoft.azure.management.network.v2019_02_01.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Defines web application firewall policy. + */ +@JsonFlatten +@SkipParentValidation +public class WebApplicationFirewallPolicyInner extends Resource { + /** + * Describes policySettings for policy. + */ + @JsonProperty(value = "properties.policySettings") + private PolicySettings policySettings; + + /** + * Describes custom rules inside the policy. + */ + @JsonProperty(value = "properties.customRules") + private List customRules; + + /** + * A collection of references to application gateways. + */ + @JsonProperty(value = "properties.applicationGateways", access = JsonProperty.Access.WRITE_ONLY) + private List applicationGateways; + + /** + * Provisioning state of the WebApplicationFirewallPolicy. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource status of the policy. + * Resource status of the policy. Possible values include: 'Creating', + * 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private WebApplicationFirewallPolicyResourceState resourceState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get describes policySettings for policy. + * + * @return the policySettings value + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set describes policySettings for policy. + * + * @param policySettings the policySettings value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + return this; + } + + /** + * Get describes custom rules inside the policy. + * + * @return the customRules value + */ + public List customRules() { + return this.customRules; + } + + /** + * Set describes custom rules inside the policy. + * + * @param customRules the customRules value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withCustomRules(List customRules) { + this.customRules = customRules; + return this; + } + + /** + * Get a collection of references to application gateways. + * + * @return the applicationGateways value + */ + public List applicationGateways() { + return this.applicationGateways; + } + + /** + * Get provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get resource status of the policy. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting'. + * + * @return the resourceState value + */ + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.resourceState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/package-info.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/package-info.java new file mode 100644 index 0000000000000..a30c1819d2e2c --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2019_02_01.implementation; diff --git a/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/package-info.java b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/package-info.java new file mode 100644 index 0000000000000..e49af3f9842dd --- /dev/null +++ b/network/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2019_02_01; diff --git a/package.json b/package.json index a6b12462cf587..11caf1d7b2427 100644 --- a/package.json +++ b/package.json @@ -25,5 +25,8 @@ "gulp-shell": "^0.5.1", "p-all": "^1.0.0", "yargs": "3.31.0" + }, + "dependencies": { + "node": "^10.15.3" } }