From c8124bd297f99eb350f057580e17224eb15c6212 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 7 Aug 2018 19:11:14 +0000 Subject: [PATCH 1/6] Generated from 6ad7c8a080cf905ffcbe9c42c0382059ce753188 Added NetworkConfigurationDiagnostic rest API + example --- .../EvaluatedNetworkSecurityGroup.java | 85 +++++++++ .../network/v2018_06_01/MatchedRule.java | 70 +++++++ ...workConfigurationDiagnosticParameters.java | 61 ++++++ ...etworkConfigurationDiagnosticResponse.java | 26 +++ .../NetworkConfigurationDiagnosticResult.java | 70 +++++++ .../NetworkSecurityGroupResult.java | 60 ++++++ .../NetworkSecurityRulesEvaluationResult.java | 173 +++++++++++++++++ .../network/v2018_06_01/NetworkWatchers.java | 11 ++ .../network/v2018_06_01/TrafficQuery.java | 150 +++++++++++++++ ...rkConfigurationDiagnosticResponseImpl.java | 33 ++++ ...kConfigurationDiagnosticResponseInner.java | 34 ++++ .../implementation/NetworkWatchersImpl.java | 13 ++ .../implementation/NetworkWatchersInner.java | 179 ++++++++++++++++++ 13 files changed, 965 insertions(+) create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 000000000000..ff9dc1fc588e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluatedNetworkSecurityGroup.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.v2018_06_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; + + /** + * The matchedRule property. + */ + @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 the matchedRule value. + * + * @return the matchedRule value + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule value. + * + * @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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MatchedRule.java new file mode 100644 index 000000000000..c29c5b5cb061 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java new file mode 100644 index 000000000000..ed77d3f46730 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.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.v2018_06_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; + + /** + * List of traffic queries. + */ + @JsonProperty(value = "queries", required = true, access = JsonProperty.Access.WRITE_ONLY) + private List queries; + + /** + * 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 list of traffic queries. + * + * @return the queries value + */ + public List queries() { + return this.queries; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 000000000000..e4cc4bfe17bc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 000000000000..eab7413d051b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + */ +public class NetworkConfigurationDiagnosticResult { + /** + * The trafficQuery property. + */ + @JsonProperty(value = "trafficQuery") + private TrafficQuery trafficQuery; + + /** + * The networkSecurityGroupResult property. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the trafficQuery value. + * + * @return the trafficQuery value + */ + public TrafficQuery trafficQuery() { + return this.trafficQuery; + } + + /** + * Set the trafficQuery value. + * + * @param trafficQuery the trafficQuery value to set + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withTrafficQuery(TrafficQuery trafficQuery) { + this.trafficQuery = trafficQuery; + return this; + } + + /** + * Get the networkSecurityGroupResult value. + * + * @return the networkSecurityGroupResult value + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult value. + * + * @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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupResult.java new file mode 100644 index 000000000000..fb373a464c1e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_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 are 'Allow' + * and 'Deny'. 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 are 'Allow' and 'Deny'. 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 are 'Allow' and 'Deny'. 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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityRulesEvaluationResult.java new file mode 100644 index 000000000000..82615fa2c8a5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java index a462c56dd7af..c015d3ae2941 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -144,4 +144,15 @@ public interface NetworkWatchers extends SupportsCreating 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 targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.java new file mode 100644 index 000000000000..e7e6df6da5e8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficQuery.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.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to compare with network configuration. + */ +public class TrafficQuery { + /** + * The direction of the traffic. Accepted values are 'Inbound' and + * 'Outbound'. 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; + + /** + * Traffice 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. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the traffic. Accepted values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the TrafficQuery object itself. + */ + public TrafficQuery 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 TrafficQuery object itself. + */ + public TrafficQuery 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 TrafficQuery object itself. + */ + public TrafficQuery 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 TrafficQuery object itself. + */ + public TrafficQuery withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get traffice 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 traffice 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 TrafficQuery object itself. + */ + public TrafficQuery withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 000000000000..086b2c0b98e0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkConfigurationDiagnosticResponseInner.java new file mode 100644 index 000000000000..943542f188a3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java index 9e02b34355a7..f71022131e9f 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java @@ -31,6 +31,7 @@ import com.microsoft.azure.management.network.v2018_06_01.ConnectivityInformation; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReport; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersList; +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticResponse; import com.microsoft.azure.management.network.v2018_06_01.TopologyParameters; import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; @@ -273,6 +274,18 @@ public AvailableProvidersList call(AvailableProvidersListInner inner) { }); } + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, targetResourceId) + .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()); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index 55944e5794da..ba92f22b4b52 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -18,6 +18,7 @@ import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; import com.microsoft.azure.management.network.v2018_06_01.QueryTroubleshootingParameters; import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewParameters; @@ -187,6 +188,14 @@ interface NetworkWatchersService { @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.v2018_06_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NetworkConfigurationDiagnosticParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NetworkConfigurationDiagnosticParameters parameters, @Header("User-Agent") String userAgent); + } /** @@ -2630,4 +2639,174 @@ private ServiceResponse beginListAvailableProviders .build(response); } + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and 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 NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and 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 getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).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 targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(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 = "2018-06-01"; + NetworkConfigurationDiagnosticParameters parameters = new NetworkConfigurationDiagnosticParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and 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 NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and 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 beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).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 targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(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 = "2018-06-01"; + NetworkConfigurationDiagnosticParameters parameters = new NetworkConfigurationDiagnosticParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetNetworkConfigurationDiagnostic(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 = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(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); + } + } From a185c0d93834bbc6a23d14b76718dcb472f17b45 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 7 Aug 2018 22:13:17 +0000 Subject: [PATCH 2/6] Generated from 6909b52c5e23056444d410930b8702e7540811e2 Removed 'read-only' from queries in NetworkConfigurationDiagnostic API --- ...workConfigurationDiagnosticParameters.java | 13 +++- .../network/v2018_06_01/NetworkWatchers.java | 4 +- .../implementation/NetworkWatchersImpl.java | 5 +- .../implementation/NetworkWatchersInner.java | 66 +++++++++---------- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java index ed77d3f46730..224226c2db34 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkConfigurationDiagnosticParameters.java @@ -26,7 +26,7 @@ public class NetworkConfigurationDiagnosticParameters { /** * List of traffic queries. */ - @JsonProperty(value = "queries", required = true, access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "queries", required = true) private List queries; /** @@ -58,4 +58,15 @@ public List queries() { return this.queries; } + /** + * Set list of traffic queries. + * + * @param queries the queries value to set + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withQueries(List queries) { + this.queries = queries; + return this; + } + } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java index c015d3ae2941..f569672a812b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -149,10 +149,10 @@ public interface NetworkWatchers extends SupportsCreating getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java index f71022131e9f..53af037b2e3c 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java @@ -39,6 +39,7 @@ import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; class NetworkWatchersImpl extends GroupableResourcesCoreImpl implements NetworkWatchers { protected NetworkWatchersImpl(NetworkManager manager) { @@ -275,9 +276,9 @@ public AvailableProvidersList call(AvailableProvidersListInner inner) { } @Override - public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { NetworkWatchersInner client = this.inner(); - return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, targetResourceId) + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) .map(new Func1() { @Override public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index ba92f22b4b52..9b0b3059ede5 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -190,11 +190,11 @@ interface NetworkWatchersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NetworkConfigurationDiagnosticParameters parameters, @Header("User-Agent") String userAgent); + 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.v2018_06_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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NetworkConfigurationDiagnosticParameters parameters, @Header("User-Agent") String userAgent); + 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); } @@ -2644,14 +2644,14 @@ private ServiceResponse beginListAvailableProviders * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @param parameters Parameters to get network configuration diagnostic. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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, String targetResourceId) { - return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); } /** @@ -2659,13 +2659,13 @@ public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagno * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @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, String targetResourceId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); } /** @@ -2673,12 +2673,12 @@ public ServiceFuture getNetworkConf * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @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, String targetResourceId) { - return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + 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(); @@ -2691,11 +2691,11 @@ public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2705,13 +2705,12 @@ public Observable> 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."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + Validator.validate(parameters); final String apiVersion = "2018-06-01"; - NetworkConfigurationDiagnosticParameters parameters = new NetworkConfigurationDiagnosticParameters(); - parameters.withTargetResourceId(targetResourceId); - Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + Observable> observable = service.getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -2720,14 +2719,14 @@ public Observable> * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @param parameters Parameters to get network configuration diagnostic. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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, String targetResourceId) { - return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); } /** @@ -2735,13 +2734,13 @@ public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationD * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @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, String targetResourceId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); } /** @@ -2749,12 +2748,12 @@ public ServiceFuture beginGetNetwor * * @param resourceGroupName The name of the resource group. * @param networkWatcherName The name of the network watcher. - * @param targetResourceId The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * @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, String targetResourceId) { - return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + 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(); @@ -2767,11 +2766,11 @@ public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2781,13 +2780,12 @@ public Observable> 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."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + Validator.validate(parameters); final String apiVersion = "2018-06-01"; - NetworkConfigurationDiagnosticParameters parameters = new NetworkConfigurationDiagnosticParameters(); - parameters.withTargetResourceId(targetResourceId); - return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + 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) { From 2418e70ac821bb89eba39162da20fd1921ba2e2e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 11 Aug 2018 17:18:08 +0000 Subject: [PATCH 3/6] Generated from f12e6b41326c05506097b75dce076c297074a3d2 Fixed example name --- .../ConnectionMonitorsQueryResultItem.java | 32 + .../network/v2018_06_01/NetworkWatchers.java | 10 + .../QueryConnectionMonitorsParameters.java | 44 ++ ...ConnectionMonitorsQueryResultItemImpl.java | 37 + ...onnectionMonitorsQueryResultItemInner.java | 70 ++ .../implementation/NetworkWatchersImpl.java | 19 + .../implementation/NetworkWatchersInner.java | 738 ++++++++++++++++++ 7 files changed, 950 insertions(+) create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryConnectionMonitorsParameters.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java new file mode 100644 index 000000000000..2ca884854752 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.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.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorsQueryResultItemInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** + * Type representing ConnectionMonitorsQueryResultItem. + */ +public interface ConnectionMonitorsQueryResultItem extends HasInner, HasManager { + /** + * @return the report value. + */ + List report(); + + /** + * @return the resourceId value. + */ + String resourceId(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java index f569672a812b..0255bf43ad15 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -155,4 +155,14 @@ public interface NetworkWatchers extends SupportsCreating getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + /** + * Query connection monitors. + * + * @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 + */ + Observable queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName); + } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryConnectionMonitorsParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryConnectionMonitorsParameters.java new file mode 100644 index 000000000000..a775c084eeec --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryConnectionMonitorsParameters.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.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to query connection monitors. + */ +public class QueryConnectionMonitorsParameters { + /** + * List of connection monitors ID. + */ + @JsonProperty(value = "connectionMonitorIds") + private List connectionMonitorIds; + + /** + * Get list of connection monitors ID. + * + * @return the connectionMonitorIds value + */ + public List connectionMonitorIds() { + return this.connectionMonitorIds; + } + + /** + * Set list of connection monitors ID. + * + * @param connectionMonitorIds the connectionMonitorIds value to set + * @return the QueryConnectionMonitorsParameters object itself. + */ + public QueryConnectionMonitorsParameters withConnectionMonitorIds(List connectionMonitorIds) { + this.connectionMonitorIds = connectionMonitorIds; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java new file mode 100644 index 000000000000..3d039b642639 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.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.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorsQueryResultItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ConnectionMonitorsQueryResultItemImpl extends WrapperImpl implements ConnectionMonitorsQueryResultItem { + private final NetworkManager manager; + ConnectionMonitorsQueryResultItemImpl(ConnectionMonitorsQueryResultItemInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List report() { + return this.inner().report(); + } + + @Override + public String resourceId() { + return this.inner().resourceId(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java new file mode 100644 index 000000000000..f46a3898f81c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.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.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of query particular connection monitor. + */ +public class ConnectionMonitorsQueryResultItemInner { + /** + * Connection monitor resource ID. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * List of connection monitors query results. + */ + @JsonProperty(value = "report") + private List report; + + /** + * Get connection monitor resource ID. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set connection monitor resource ID. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorsQueryResultItemInner object itself. + */ + public ConnectionMonitorsQueryResultItemInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get list of connection monitors query results. + * + * @return the report value + */ + public List report() { + return this.report; + } + + /** + * Set list of connection monitors query results. + * + * @param report the report value to set + * @return the ConnectionMonitorsQueryResultItemInner object itself. + */ + public ConnectionMonitorsQueryResultItemInner withReport(List report) { + this.report = report; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java index 53af037b2e3c..037d43dd27d2 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java @@ -32,6 +32,7 @@ import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReport; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersList; import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticResponse; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorsQueryResultItem; import com.microsoft.azure.management.network.v2018_06_01.TopologyParameters; import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; @@ -287,6 +288,24 @@ public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosti }); } + @Override + public Observable queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { + NetworkWatchersInner client = this.inner(); + return client.queryConnectionMonitorsAsync(resourceGroupName, networkWatcherName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ConnectionMonitorsQueryResultItem call(ConnectionMonitorsQueryResultItemInner inner) { + return new ConnectionMonitorsQueryResultItemImpl(inner, manager()); + } + }); + } + @Override protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { return new NetworkWatcherImpl(inner.name(), inner, manager()); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index 9b0b3059ede5..ce78c26016fa 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -13,13 +13,16 @@ 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.v2018_06_01.AvailableProvidersListParameters; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_06_01.QueryConnectionMonitorsParameters; import com.microsoft.azure.management.network.v2018_06_01.QueryTroubleshootingParameters; import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewParameters; import com.microsoft.azure.management.network.v2018_06_01.TagsObject; @@ -46,6 +49,7 @@ 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; @@ -196,6 +200,22 @@ interface NetworkWatchersService { @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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers queryConnectionMonitors" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors") + Observable> queryConnectionMonitors(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryConnectionMonitorsParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginQueryConnectionMonitors" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors") + Observable> beginQueryConnectionMonitors(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryConnectionMonitorsParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers queryConnectionMonitorsNext" }) + @GET + Observable> queryConnectionMonitorsNext(@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.v2018_06_01.NetworkWatchers beginQueryConnectionMonitorsNext" }) + @GET + Observable> beginQueryConnectionMonitorsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -2807,4 +2827,722 @@ private ServiceResponse beginGetNet .build(response); } + /** + * Query connection monitors. + * + * @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 CloudException 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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList queryConnectionMonitors(final String resourceGroupName, final String networkWatcherName) { + ServiceResponse> response = queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @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> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { + return queryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> queryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName) { + return queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName) + .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(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> queryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final 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 = "2018-06-01"; + final List connectionMonitorIds = null; + QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); + parameters.withConnectionMonitorIds(null); + return service.queryConnectionMonitors(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> result = queryConnectionMonitorsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList queryConnectionMonitors(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + ServiceResponse> response = queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + return queryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> queryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + return queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) + .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(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkWatcherName The name of the network watcher. + ServiceResponse> * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> queryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + 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(connectionMonitorIds); + final String apiVersion = "2018-06-01"; + QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); + parameters.withConnectionMonitorIds(connectionMonitorIds); + return service.queryConnectionMonitors(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> result = queryConnectionMonitorsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> queryConnectionMonitorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(202, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Query connection monitors. + * + * @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 CloudException 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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList beginQueryConnectionMonitors(final String resourceGroupName, final String networkWatcherName) { + ServiceResponse> response = beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @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> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { + return beginQueryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> beginQueryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName) { + return beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName) + .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(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> beginQueryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final 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 = "2018-06-01"; + final List connectionMonitorIds = null; + QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); + parameters.withConnectionMonitorIds(null); + return service.beginQueryConnectionMonitors(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> result = beginQueryConnectionMonitorsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList beginQueryConnectionMonitors(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + ServiceResponse> response = beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + return beginQueryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> beginQueryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + return beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) + .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(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkWatcherName The name of the network watcher. + ServiceResponse> * @param connectionMonitorIds List of connection monitors ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> beginQueryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { + 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(connectionMonitorIds); + final String apiVersion = "2018-06-01"; + QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); + parameters.withConnectionMonitorIds(connectionMonitorIds); + return service.beginQueryConnectionMonitors(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> result = beginQueryConnectionMonitorsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> beginQueryConnectionMonitorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(202, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList queryConnectionMonitorsNext(final String nextPageLink) { + ServiceResponse> response = queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @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> queryConnectionMonitorsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + queryConnectionMonitorsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> queryConnectionMonitorsNextAsync(final String nextPageLink) { + return queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> queryConnectionMonitorsNextWithServiceResponseAsync(final String nextPageLink) { + return queryConnectionMonitorsNextSinglePageAsync(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(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> queryConnectionMonitorsNextSinglePageAsync(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.queryConnectionMonitorsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = queryConnectionMonitorsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> queryConnectionMonitorsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(202, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object if successful. + */ + public PagedList beginQueryConnectionMonitorsNext(final String nextPageLink) { + ServiceResponse> response = beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Query connection monitors. + * + * @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> beginQueryConnectionMonitorsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable> beginQueryConnectionMonitorsNextAsync(final String nextPageLink) { + return beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Query connection monitors. + * + * @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<ConnectionMonitorsQueryResultItemInner> object + */ + public Observable>> beginQueryConnectionMonitorsNextWithServiceResponseAsync(final String nextPageLink) { + return beginQueryConnectionMonitorsNextSinglePageAsync(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(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Query connection monitors. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> beginQueryConnectionMonitorsNextSinglePageAsync(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.beginQueryConnectionMonitorsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = beginQueryConnectionMonitorsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> beginQueryConnectionMonitorsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(202, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } From e268245296d9cfb2bec741626ef6f9c5bb06ce5e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 14 Aug 2018 06:24:00 +0000 Subject: [PATCH 4/6] Generated from 9e5daf5f1cd3c59140eec06d6fb55e6456323c54 Fixed reference to ErrorDetails --- .../network/v2018_06_01/ErrorResponse.java | 43 ++++ .../v2018_06_01/ErrorResponseException.java | 44 ++++ .../ConnectionMonitorsInner.java | 68 +++--- .../implementation/NetworkWatchersInner.java | 204 +++++++++--------- .../implementation/PacketCapturesInner.java | 58 ++--- 5 files changed, 252 insertions(+), 165 deletions(-) create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java create mode 100644 network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.java new file mode 100644 index 000000000000..ebc7b2804da1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponse.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.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponse { + /** + * Error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the error value. + * + * @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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorResponseException.java new file mode 100644 index 000000000000..01fd627d673e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_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.v2018_06_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/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java index c5133805d595..39dcc185e72d 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2018_06_01.ErrorResponseException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -115,7 +115,7 @@ interface ConnectionMonitorsService { * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -197,7 +197,7 @@ public Observable> createOrUpdateW * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -281,11 +281,11 @@ public Observable> call(Response beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -296,7 +296,7 @@ private ServiceResponse beginCreateOrUpdateDelegat * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -373,10 +373,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -387,7 +387,7 @@ private ServiceResponse getDelegate(Response> deleteWithServiceResponseAsync(String r * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -536,11 +536,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -551,7 +551,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -624,7 +624,7 @@ public Observable> stopWithServiceResponseAsync(String res * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -700,11 +700,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -715,7 +715,7 @@ private ServiceResponse beginStopDelegate(Response response) * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -788,7 +788,7 @@ public Observable> startWithServiceResponseAsync(String re * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -864,11 +864,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -879,7 +879,7 @@ private ServiceResponse beginStartDelegate(Response response * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -953,7 +953,7 @@ public Observable> queryWithS * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1030,11 +1030,11 @@ public Observable> call(Respo }); } - private ServiceResponse beginQueryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1044,7 +1044,7 @@ private ServiceResponse beginQueryDelegate(Re * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1120,10 +1120,10 @@ public Observable>> call(Resp }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index ce78c26016fa..ee07621cba7b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -14,11 +14,11 @@ 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.v2018_06_01.AvailableProvidersListParameters; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_06_01.ErrorResponseException; import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; @@ -225,7 +225,7 @@ interface NetworkWatchersService { * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -303,11 +303,11 @@ public Observable> call(Response createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -317,7 +317,7 @@ private ServiceResponse createOrUpdateDelegate(Response> call(Response getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -401,7 +401,7 @@ private ServiceResponse getByResourceGroupDelegate(Response * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -467,7 +467,7 @@ public Observable> deleteWithServiceResponseAsync(String r * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -537,11 +537,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -551,7 +551,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -632,7 +632,7 @@ public Observable> call(Response> call(Response updateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -795,10 +795,10 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -874,10 +874,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -888,7 +888,7 @@ private ServiceResponse> listDelegate(Response> call(Response re }); } - private ServiceResponse getTopologyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getTopologyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -980,7 +980,7 @@ private ServiceResponse getTopologyDelegate(Response> verifyIPFlowWi * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1133,11 +1133,11 @@ public Observable> call(Response< }); } - private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1148,7 +1148,7 @@ private ServiceResponse beginVerifyIPFlowDelegate * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1223,7 +1223,7 @@ public Observable> getNextHopWithServiceResp * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1301,11 +1301,11 @@ public Observable> call(Response beginGetNextHopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1316,7 +1316,7 @@ private ServiceResponse beginGetNextHopDelegate(Response> getVMSecurityRu * @param networkWatcherName The name of the network watcher. * @param targetResourceId ID of the target VM. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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. */ @@ -1471,11 +1471,11 @@ public Observable> call(Response beginGetVMSecurityRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1486,7 +1486,7 @@ private ServiceResponse beginGetVMSecurityRulesDel * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1561,7 +1561,7 @@ public Observable> getTroubleshootin * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1639,11 +1639,11 @@ public Observable> call(Response beginGetTroubleshootingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1654,7 +1654,7 @@ private ServiceResponse beginGetTroubleshootingDeleg * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1730,7 +1730,7 @@ public Observable> getTroubleshootin * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1809,11 +1809,11 @@ public Observable> call(Response beginGetTroubleshootingResultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1824,7 +1824,7 @@ private ServiceResponse beginGetTroubleshootingResul * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1899,7 +1899,7 @@ public Observable> setFlowLogConfigurat * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -1977,11 +1977,11 @@ public Observable> call(Response beginSetFlowLogConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1992,7 +1992,7 @@ private ServiceResponse beginSetFlowLogConfigurationDel * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2068,7 +2068,7 @@ public Observable> getFlowLogStatusWith * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2147,11 +2147,11 @@ public Observable> call(Response beginGetFlowLogStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2162,7 +2162,7 @@ private ServiceResponse beginGetFlowLogStatusDelegate(R * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2237,7 +2237,7 @@ public Observable> checkConnectivi * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2315,11 +2315,11 @@ public Observable> call(Response beginCheckConnectivityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2330,7 +2330,7 @@ private ServiceResponse beginCheckConnectivityDele * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2405,7 +2405,7 @@ public Observable> getAzureReachab * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2483,11 +2483,11 @@ public Observable> call(Response beginGetAzureReachabilityReportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2498,7 +2498,7 @@ private ServiceResponse beginGetAzureReachabilityR * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2573,7 +2573,7 @@ public Observable> listAvailablePro * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2651,11 +2651,11 @@ public Observable> call(Response beginListAvailableProvidersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2666,7 +2666,7 @@ private ServiceResponse beginListAvailableProviders * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2741,7 +2741,7 @@ public Observable> * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -2819,11 +2819,11 @@ public Observable> }); } - private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -2833,7 +2833,7 @@ private ServiceResponse beginGetNet * @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 CloudException thrown if the request is rejected by server + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -2951,7 +2951,7 @@ public Observable>> * @param networkWatcherName The name of the network watcher. * @param connectionMonitorIds List of connection monitors ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -3066,11 +3066,11 @@ public Observable>> }); } - private ServiceResponse> queryConnectionMonitorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> queryConnectionMonitorsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException, InterruptedException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .register(202, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -3080,7 +3080,7 @@ private ServiceResponse> queryC * @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 CloudException thrown if the request is rejected by server + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -3198,7 +3198,7 @@ public Observable>> * @param networkWatcherName The name of the network watcher. * @param connectionMonitorIds List of connection monitors ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -3313,11 +3313,11 @@ public Observable>> }); } - private ServiceResponse> beginQueryConnectionMonitorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> beginQueryConnectionMonitorsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .register(202, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -3326,7 +3326,7 @@ private ServiceResponse> beginQ * * @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 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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -3425,11 +3425,11 @@ public Observable>> }); } - private ServiceResponse> queryConnectionMonitorsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> queryConnectionMonitorsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException, InterruptedException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .register(202, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -3438,7 +3438,7 @@ private ServiceResponse> queryC * * @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 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 PagedList<ConnectionMonitorsQueryResultItemInner> object if successful. */ @@ -3537,11 +3537,11 @@ public Observable>> }); } - private ServiceResponse> beginQueryConnectionMonitorsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> beginQueryConnectionMonitorsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .register(202, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java index 4f02bd28df55..230bc3fbf256 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2018_06_01.ErrorResponseException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -107,7 +107,7 @@ interface PacketCapturesService { * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -189,7 +189,7 @@ public Observable> createWithServiceRe * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -273,10 +273,10 @@ public Observable> call(Response beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -287,7 +287,7 @@ private ServiceResponse beginCreateDelegate(Response> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -378,7 +378,7 @@ private ServiceResponse getDelegate(Response> deleteWithServiceResponseAsync(String r * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -527,11 +527,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -542,7 +542,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -615,7 +615,7 @@ public Observable> stopWithServiceResponseAsync(String res * @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 CloudException thrown if the request is rejected by server + * @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) { @@ -691,11 +691,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -706,7 +706,7 @@ private ServiceResponse beginStopDelegate(Response response) * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -780,7 +780,7 @@ public Observable> getStatu * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -857,11 +857,11 @@ public Observable> call(Res }); } - private ServiceResponse beginGetStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -871,7 +871,7 @@ private ServiceResponse beginGetStatusDeleg * @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 CloudException thrown if the request is rejected by server + * @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. */ @@ -947,10 +947,10 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + 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(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } From c22013bbebf3787485ce2326ab7683b0b3e9916d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 15 Aug 2018 18:34:24 +0000 Subject: [PATCH 5/6] Generated from 0858a238c818aa119584a9d61deddc2a26494de9 Fixed response for QueryConnectionMonitors API + fixed example --- .../ConnectionMonitorsQueryResultItem.java | 3 +-- .../ConnectionMonitorsQueryResultItemImpl.java | 3 +-- .../ConnectionMonitorsQueryResultItemInner.java | 13 ++++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java index 2ca884854752..c39bfaa6cd56 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorsQueryResultItem.java @@ -13,7 +13,6 @@ import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorsQueryResultItemInner; import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorQueryResultInner; -import java.util.List; /** * Type representing ConnectionMonitorsQueryResultItem. @@ -22,7 +21,7 @@ public interface ConnectionMonitorsQueryResultItem extends HasInner report(); + ConnectionMonitorQueryResultInner report(); /** * @return the resourceId value. diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java index 3d039b642639..561ba3948ca0 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorsQueryResultItem; import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import java.util.List; class ConnectionMonitorsQueryResultItemImpl extends WrapperImpl implements ConnectionMonitorsQueryResultItem { private final NetworkManager manager; @@ -25,7 +24,7 @@ public NetworkManager manager() { } @Override - public List report() { + public ConnectionMonitorQueryResultInner report() { return this.inner().report(); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java index f46a3898f81c..9a9fb1b37f17 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsQueryResultItemInner.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.network.v2018_06_01.implementation; -import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -22,10 +21,10 @@ public class ConnectionMonitorsQueryResultItemInner { private String resourceId; /** - * List of connection monitors query results. + * The report property. */ @JsonProperty(value = "report") - private List report; + private ConnectionMonitorQueryResultInner report; /** * Get connection monitor resource ID. @@ -48,21 +47,21 @@ public ConnectionMonitorsQueryResultItemInner withResourceId(String resourceId) } /** - * Get list of connection monitors query results. + * Get the report value. * * @return the report value */ - public List report() { + public ConnectionMonitorQueryResultInner report() { return this.report; } /** - * Set list of connection monitors query results. + * Set the report value. * * @param report the report value to set * @return the ConnectionMonitorsQueryResultItemInner object itself. */ - public ConnectionMonitorsQueryResultItemInner withReport(List report) { + public ConnectionMonitorsQueryResultItemInner withReport(ConnectionMonitorQueryResultInner report) { this.report = report; return this; } From b7d003be186ab88eb577177ce43807d61919bff0 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 15 Aug 2018 21:02:03 +0000 Subject: [PATCH 6/6] Generated from 377e5cc3f8f10f71d7816d78462fbb68685453bd Fixed types for latencies in networkwatcher.json --- .../v2018_06_01/ConnectionStateSnapshot.java | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java index 7048fd55a4b8..b7ac63365a21 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java @@ -42,6 +42,36 @@ public class ConnectionStateSnapshot { @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. */ @@ -128,6 +158,106 @@ public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationSta 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. *