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. * 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/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..224226c2db34 --- /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,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.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) + 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; + } + + /** + * 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/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..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 @@ -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 parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + } diff --git a/network/resource-manager/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/VirtualNetworkGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java index 2d4cdfa896bb..394db18d0a0b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java @@ -34,6 +34,16 @@ public interface VirtualNetworkGateways extends SupportsCreating resetAsync(String resourceGroupName, String virtualNetworkGatewayName); + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName); + /** * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. * 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/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..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 @@ -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; @@ -38,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) { @@ -273,6 +275,18 @@ public AvailableProvidersList call(AvailableProvidersListInner inner) { }); } + @Override + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosticResponseInner inner) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, manager()); + } + }); + } + @Override protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { return new NetworkWatcherImpl(inner.name(), inner, manager()); 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..17ff5136b449 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,11 +13,12 @@ import com.microsoft.azure.arm.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; import com.microsoft.azure.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; 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, @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, @Body NetworkConfigurationDiagnosticParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -196,7 +205,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. */ @@ -274,11 +283,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); } @@ -288,7 +297,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); } @@ -372,7 +381,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) { @@ -438,7 +447,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) { @@ -508,11 +517,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); } @@ -522,7 +531,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. */ @@ -603,7 +612,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); } @@ -766,10 +775,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); } @@ -845,10 +854,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); } @@ -859,7 +868,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); } @@ -951,7 +960,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. */ @@ -1104,11 +1113,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); } @@ -1119,7 +1128,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. */ @@ -1194,7 +1203,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. */ @@ -1272,11 +1281,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); } @@ -1287,7 +1296,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. */ @@ -1442,11 +1451,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); } @@ -1457,7 +1466,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. */ @@ -1532,7 +1541,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. */ @@ -1610,11 +1619,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); } @@ -1625,7 +1634,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. */ @@ -1701,7 +1710,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. */ @@ -1780,11 +1789,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); } @@ -1795,7 +1804,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. */ @@ -1870,7 +1879,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. */ @@ -1948,11 +1957,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); } @@ -1963,7 +1972,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. */ @@ -2039,7 +2048,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. */ @@ -2118,11 +2127,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); } @@ -2133,7 +2142,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. */ @@ -2208,7 +2217,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. */ @@ -2286,11 +2295,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); } @@ -2301,7 +2310,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. */ @@ -2376,7 +2385,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. */ @@ -2454,11 +2463,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); } @@ -2469,7 +2478,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. */ @@ -2544,7 +2553,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. */ @@ -2622,11 +2631,179 @@ 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); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner getNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + 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()); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkConfigurationDiagnosticResponseInner object if successful. + */ + public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkConfigurationDiagnosticResponseInner>() { + @Override + public NetworkConfigurationDiagnosticResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get network configuration diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkConfigurationDiagnosticResponseInner object + */ + public Observable> beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNetworkConfigurationDiagnosticDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNetworkConfigurationDiagnosticDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/network/resource-manager/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); } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java index 605cbe0c8669..9b8004a7480f 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java @@ -119,6 +119,12 @@ public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { }); } + @Override + public Completable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); + } + @Override public Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { VirtualNetworkGatewaysInner client = this.inner(); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java index bdc1fc7f4891..ed60768343ff 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java @@ -113,6 +113,14 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways resetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> resetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginResetVpnClientSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + Observable> beginResetVpnClientSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways generatevpnclientpackage" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1451,6 +1459,156 @@ private ServiceResponse beginResetDelegate(Response< .build(response); } + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetVpnClientSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetVpnClientSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetVpnClientSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetVpnClientSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. *