diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java new file mode 100644 index 00000000000..7675b3e7a0e --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to check Traffic Manager name operation. + */ +public class CheckTrafficManagerRelativeDnsNameAvailabilityParameters { + /** + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointMonitorStatus.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointMonitorStatus.java index bc7b2c5148e..0ab13ce9bc7 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointMonitorStatus.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointMonitorStatus.java @@ -8,64 +8,46 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for EndpointMonitorStatus. */ -public final class EndpointMonitorStatus { +public final class EndpointMonitorStatus extends ExpandableStringEnum { /** Static value CheckingEndpoint for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus CHECKING_ENDPOINT = new EndpointMonitorStatus("CheckingEndpoint"); + public static final EndpointMonitorStatus CHECKING_ENDPOINT = fromString("CheckingEndpoint"); /** Static value Online for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus ONLINE = new EndpointMonitorStatus("Online"); + public static final EndpointMonitorStatus ONLINE = fromString("Online"); /** Static value Degraded for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus DEGRADED = new EndpointMonitorStatus("Degraded"); + public static final EndpointMonitorStatus DEGRADED = fromString("Degraded"); /** Static value Disabled for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus DISABLED = new EndpointMonitorStatus("Disabled"); + public static final EndpointMonitorStatus DISABLED = fromString("Disabled"); /** Static value Inactive for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus INACTIVE = new EndpointMonitorStatus("Inactive"); + public static final EndpointMonitorStatus INACTIVE = fromString("Inactive"); /** Static value Stopped for EndpointMonitorStatus. */ - public static final EndpointMonitorStatus STOPPED = new EndpointMonitorStatus("Stopped"); - - private String value; + public static final EndpointMonitorStatus STOPPED = fromString("Stopped"); /** - * Creates a custom value for EndpointMonitorStatus. - * @param value the custom value + * Creates or finds a EndpointMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointMonitorStatus */ - public EndpointMonitorStatus(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static EndpointMonitorStatus fromString(String name) { + return fromString(name, EndpointMonitorStatus.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof EndpointMonitorStatus)) { - return false; - } - if (obj == this) { - return true; - } - EndpointMonitorStatus rhs = (EndpointMonitorStatus) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known EndpointMonitorStatus values + */ + public static Collection values() { + return values(EndpointMonitorStatus.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointPropertiesCustomHeadersItem.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointPropertiesCustomHeadersItem.java new file mode 100644 index 00000000000..32faa6356fe --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointPropertiesCustomHeadersItem.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom header name and value. + */ +public class EndpointPropertiesCustomHeadersItem { + /** + * Header name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Header value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the EndpointPropertiesCustomHeadersItem object itself. + */ + public EndpointPropertiesCustomHeadersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the EndpointPropertiesCustomHeadersItem object itself. + */ + public EndpointPropertiesCustomHeadersItem withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointStatus.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointStatus.java index 1ce5c147901..d6f624923db 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointStatus.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/EndpointStatus.java @@ -8,52 +8,34 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for EndpointStatus. */ -public final class EndpointStatus { +public final class EndpointStatus extends ExpandableStringEnum { /** Static value Enabled for EndpointStatus. */ - public static final EndpointStatus ENABLED = new EndpointStatus("Enabled"); + public static final EndpointStatus ENABLED = fromString("Enabled"); /** Static value Disabled for EndpointStatus. */ - public static final EndpointStatus DISABLED = new EndpointStatus("Disabled"); - - private String value; + public static final EndpointStatus DISABLED = fromString("Disabled"); /** - * Creates a custom value for EndpointStatus. - * @param value the custom value + * Creates or finds a EndpointStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointStatus */ - public EndpointStatus(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static EndpointStatus fromString(String name) { + return fromString(name, EndpointStatus.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof EndpointStatus)) { - return false; - } - if (obj == this) { - return true; - } - EndpointStatus rhs = (EndpointStatus) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known EndpointStatus values + */ + public static Collection values() { + return values(EndpointStatus.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/HeatMapEndpoint.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/HeatMapEndpoint.java new file mode 100644 index 00000000000..b51952e08aa --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/HeatMapEndpoint.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class which is a sparse representation of a Traffic Manager endpoint. + */ +public class HeatMapEndpoint { + /** + * The ARM Resource ID of this Traffic Manager endpoint. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * A number uniquely identifying this endpoint in query experiences. + */ + @JsonProperty(value = "endpointId") + private Integer endpointId; + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the HeatMapEndpoint object itself. + */ + public HeatMapEndpoint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the endpointId value. + * + * @return the endpointId value + */ + public Integer endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId value. + * + * @param endpointId the endpointId value to set + * @return the HeatMapEndpoint object itself. + */ + public HeatMapEndpoint withEndpointId(Integer endpointId) { + this.endpointId = endpointId; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfig.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfig.java index 2c5f9a75c0d..c9ffa7f929e 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfig.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfig.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.trafficmanager; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -66,6 +67,18 @@ public class MonitorConfig { @JsonProperty(value = "toleratedNumberOfFailures") private Long toleratedNumberOfFailures; + /** + * List of custom headers. + */ + @JsonProperty(value = "customHeaders") + private List customHeaders; + + /** + * List of expected status code ranges. + */ + @JsonProperty(value = "expectedStatusCodeRanges") + private List expectedStatusCodeRanges; + /** * Get the profileMonitorStatus value. * @@ -206,4 +219,44 @@ public MonitorConfig withToleratedNumberOfFailures(Long toleratedNumberOfFailure return this; } + /** + * Get the customHeaders value. + * + * @return the customHeaders value + */ + public List customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders value. + * + * @param customHeaders the customHeaders value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withCustomHeaders(List customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the expectedStatusCodeRanges value. + * + * @return the expectedStatusCodeRanges value + */ + public List expectedStatusCodeRanges() { + return this.expectedStatusCodeRanges; + } + + /** + * Set the expectedStatusCodeRanges value. + * + * @param expectedStatusCodeRanges the expectedStatusCodeRanges value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withExpectedStatusCodeRanges(List expectedStatusCodeRanges) { + this.expectedStatusCodeRanges = expectedStatusCodeRanges; + return this; + } + } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigCustomHeadersItem.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigCustomHeadersItem.java new file mode 100644 index 00000000000..72fb48d5520 --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigCustomHeadersItem.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Custom header name and value. + */ +public class MonitorConfigCustomHeadersItem { + /** + * Header name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Header value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the MonitorConfigCustomHeadersItem object itself. + */ + public MonitorConfigCustomHeadersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the MonitorConfigCustomHeadersItem object itself. + */ + public MonitorConfigCustomHeadersItem withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigExpectedStatusCodeRangesItem.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigExpectedStatusCodeRangesItem.java new file mode 100644 index 00000000000..fc40b67bc4f --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorConfigExpectedStatusCodeRangesItem.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Min and max value of a status code range. + */ +public class MonitorConfigExpectedStatusCodeRangesItem { + /** + * Min status code. + */ + @JsonProperty(value = "min") + private Integer min; + + /** + * Max status code. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get the min value. + * + * @return the min value + */ + public Integer min() { + return this.min; + } + + /** + * Set the min value. + * + * @param min the min value to set + * @return the MonitorConfigExpectedStatusCodeRangesItem object itself. + */ + public MonitorConfigExpectedStatusCodeRangesItem withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max value. + * + * @return the max value + */ + public Integer max() { + return this.max; + } + + /** + * Set the max value. + * + * @param max the max value to set + * @return the MonitorConfigExpectedStatusCodeRangesItem object itself. + */ + public MonitorConfigExpectedStatusCodeRangesItem withMax(Integer max) { + this.max = max; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorProtocol.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorProtocol.java index 819f8ee79f0..5586a44f3d1 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorProtocol.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/MonitorProtocol.java @@ -8,55 +8,37 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for MonitorProtocol. */ -public final class MonitorProtocol { +public final class MonitorProtocol extends ExpandableStringEnum { /** Static value HTTP for MonitorProtocol. */ - public static final MonitorProtocol HTTP = new MonitorProtocol("HTTP"); + public static final MonitorProtocol HTTP = fromString("HTTP"); /** Static value HTTPS for MonitorProtocol. */ - public static final MonitorProtocol HTTPS = new MonitorProtocol("HTTPS"); + public static final MonitorProtocol HTTPS = fromString("HTTPS"); /** Static value TCP for MonitorProtocol. */ - public static final MonitorProtocol TCP = new MonitorProtocol("TCP"); - - private String value; + public static final MonitorProtocol TCP = fromString("TCP"); /** - * Creates a custom value for MonitorProtocol. - * @param value the custom value + * Creates or finds a MonitorProtocol from its string representation. + * @param name a name to look for + * @return the corresponding MonitorProtocol */ - public MonitorProtocol(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static MonitorProtocol fromString(String name) { + return fromString(name, MonitorProtocol.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof MonitorProtocol)) { - return false; - } - if (obj == this) { - return true; - } - MonitorProtocol rhs = (MonitorProtocol) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known MonitorProtocol values + */ + public static Collection values() { + return values(MonitorProtocol.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileMonitorStatus.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileMonitorStatus.java index 925fc28594f..c159c99aec2 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileMonitorStatus.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileMonitorStatus.java @@ -8,61 +8,43 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for ProfileMonitorStatus. */ -public final class ProfileMonitorStatus { +public final class ProfileMonitorStatus extends ExpandableStringEnum { /** Static value CheckingEndpoints for ProfileMonitorStatus. */ - public static final ProfileMonitorStatus CHECKING_ENDPOINTS = new ProfileMonitorStatus("CheckingEndpoints"); + public static final ProfileMonitorStatus CHECKING_ENDPOINTS = fromString("CheckingEndpoints"); /** Static value Online for ProfileMonitorStatus. */ - public static final ProfileMonitorStatus ONLINE = new ProfileMonitorStatus("Online"); + public static final ProfileMonitorStatus ONLINE = fromString("Online"); /** Static value Degraded for ProfileMonitorStatus. */ - public static final ProfileMonitorStatus DEGRADED = new ProfileMonitorStatus("Degraded"); + public static final ProfileMonitorStatus DEGRADED = fromString("Degraded"); /** Static value Disabled for ProfileMonitorStatus. */ - public static final ProfileMonitorStatus DISABLED = new ProfileMonitorStatus("Disabled"); + public static final ProfileMonitorStatus DISABLED = fromString("Disabled"); /** Static value Inactive for ProfileMonitorStatus. */ - public static final ProfileMonitorStatus INACTIVE = new ProfileMonitorStatus("Inactive"); - - private String value; + public static final ProfileMonitorStatus INACTIVE = fromString("Inactive"); /** - * Creates a custom value for ProfileMonitorStatus. - * @param value the custom value + * Creates or finds a ProfileMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileMonitorStatus */ - public ProfileMonitorStatus(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static ProfileMonitorStatus fromString(String name) { + return fromString(name, ProfileMonitorStatus.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ProfileMonitorStatus)) { - return false; - } - if (obj == this) { - return true; - } - ProfileMonitorStatus rhs = (ProfileMonitorStatus) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known ProfileMonitorStatus values + */ + public static Collection values() { + return values(ProfileMonitorStatus.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileStatus.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileStatus.java index e1eb579476e..6a5a273bb44 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileStatus.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/ProfileStatus.java @@ -8,52 +8,34 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for ProfileStatus. */ -public final class ProfileStatus { +public final class ProfileStatus extends ExpandableStringEnum { /** Static value Enabled for ProfileStatus. */ - public static final ProfileStatus ENABLED = new ProfileStatus("Enabled"); + public static final ProfileStatus ENABLED = fromString("Enabled"); /** Static value Disabled for ProfileStatus. */ - public static final ProfileStatus DISABLED = new ProfileStatus("Disabled"); - - private String value; + public static final ProfileStatus DISABLED = fromString("Disabled"); /** - * Creates a custom value for ProfileStatus. - * @param value the custom value + * Creates or finds a ProfileStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileStatus */ - public ProfileStatus(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static ProfileStatus fromString(String name) { + return fromString(name, ProfileStatus.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ProfileStatus)) { - return false; - } - if (obj == this) { - return true; - } - ProfileStatus rhs = (ProfileStatus) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known ProfileStatus values + */ + public static Collection values() { + return values(ProfileStatus.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/QueryExperience.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/QueryExperience.java new file mode 100644 index 00000000000..d8cbcad3f5d --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/QueryExperience.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager HeatMap query experience properties. + */ +public class QueryExperience { + /** + * The id of the endpoint from the 'endpoints' array which these queries + * were routed to. + */ + @JsonProperty(value = "endpointId", required = true) + private int endpointId; + + /** + * The number of queries originating from this location. + */ + @JsonProperty(value = "queryCount", required = true) + private int queryCount; + + /** + * The latency experienced by queries originating from this location. + */ + @JsonProperty(value = "latency") + private Double latency; + + /** + * Get the endpointId value. + * + * @return the endpointId value + */ + public int endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId value. + * + * @param endpointId the endpointId value to set + * @return the QueryExperience object itself. + */ + public QueryExperience withEndpointId(int endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the queryCount value. + * + * @return the queryCount value + */ + public int queryCount() { + return this.queryCount; + } + + /** + * Set the queryCount value. + * + * @param queryCount the queryCount value to set + * @return the QueryExperience object itself. + */ + public QueryExperience withQueryCount(int queryCount) { + this.queryCount = queryCount; + return this; + } + + /** + * Get the latency value. + * + * @return the latency value + */ + public Double latency() { + return this.latency; + } + + /** + * Set the latency value. + * + * @param latency the latency value to set + * @return the QueryExperience object itself. + */ + public QueryExperience withLatency(Double latency) { + this.latency = latency; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficFlow.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficFlow.java new file mode 100644 index 00000000000..57780beb0cb --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficFlow.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager HeatMap traffic flow properties. + */ +public class TrafficFlow { + /** + * The IP address that this query experience originated from. + */ + @JsonProperty(value = "sourceIp") + private String sourceIp; + + /** + * The approximate latitude that these queries originated from. + */ + @JsonProperty(value = "latitude") + private Double latitude; + + /** + * The approximate longitude that these queries originated from. + */ + @JsonProperty(value = "longitude") + private Double longitude; + + /** + * The query experiences produced in this HeatMap calculation. + */ + @JsonProperty(value = "queryExperiences") + private List queryExperiences; + + /** + * Get the sourceIp value. + * + * @return the sourceIp value + */ + public String sourceIp() { + return this.sourceIp; + } + + /** + * Set the sourceIp value. + * + * @param sourceIp the sourceIp value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + return this; + } + + /** + * Get the latitude value. + * + * @return the latitude value + */ + public Double latitude() { + return this.latitude; + } + + /** + * Set the latitude value. + * + * @param latitude the latitude value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withLatitude(Double latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get the longitude value. + * + * @return the longitude value + */ + public Double longitude() { + return this.longitude; + } + + /** + * Set the longitude value. + * + * @param longitude the longitude value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withLongitude(Double longitude) { + this.longitude = longitude; + return this; + } + + /** + * Get the queryExperiences value. + * + * @return the queryExperiences value + */ + public List queryExperiences() { + return this.queryExperiences; + } + + /** + * Set the queryExperiences value. + * + * @param queryExperiences the queryExperiences value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withQueryExperiences(List queryExperiences) { + this.queryExperiences = queryExperiences; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficRoutingMethod.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficRoutingMethod.java index 6a94e96a339..89a24d15f92 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficRoutingMethod.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficRoutingMethod.java @@ -8,58 +8,40 @@ package com.microsoft.azure.management.trafficmanager; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for TrafficRoutingMethod. */ -public final class TrafficRoutingMethod { +public final class TrafficRoutingMethod extends ExpandableStringEnum { /** Static value Performance for TrafficRoutingMethod. */ - public static final TrafficRoutingMethod PERFORMANCE = new TrafficRoutingMethod("Performance"); + public static final TrafficRoutingMethod PERFORMANCE = fromString("Performance"); /** Static value Priority for TrafficRoutingMethod. */ - public static final TrafficRoutingMethod PRIORITY = new TrafficRoutingMethod("Priority"); + public static final TrafficRoutingMethod PRIORITY = fromString("Priority"); /** Static value Weighted for TrafficRoutingMethod. */ - public static final TrafficRoutingMethod WEIGHTED = new TrafficRoutingMethod("Weighted"); + public static final TrafficRoutingMethod WEIGHTED = fromString("Weighted"); /** Static value Geographic for TrafficRoutingMethod. */ - public static final TrafficRoutingMethod GEOGRAPHIC = new TrafficRoutingMethod("Geographic"); - - private String value; + public static final TrafficRoutingMethod GEOGRAPHIC = fromString("Geographic"); /** - * Creates a custom value for TrafficRoutingMethod. - * @param value the custom value + * Creates or finds a TrafficRoutingMethod from its string representation. + * @param name a name to look for + * @return the corresponding TrafficRoutingMethod */ - public TrafficRoutingMethod(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static TrafficRoutingMethod fromString(String name) { + return fromString(name, TrafficRoutingMethod.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof TrafficRoutingMethod)) { - return false; - } - if (obj == this) { - return true; - } - TrafficRoutingMethod rhs = (TrafficRoutingMethod) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known TrafficRoutingMethod values + */ + public static Collection values() { + return values(TrafficRoutingMethod.class); } } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficViewEnrollmentStatus.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficViewEnrollmentStatus.java new file mode 100644 index 00000000000..b48ec80c32b --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/TrafficViewEnrollmentStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrafficViewEnrollmentStatus. + */ +public final class TrafficViewEnrollmentStatus extends ExpandableStringEnum { + /** Static value Enabled for TrafficViewEnrollmentStatus. */ + public static final TrafficViewEnrollmentStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for TrafficViewEnrollmentStatus. */ + public static final TrafficViewEnrollmentStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a TrafficViewEnrollmentStatus from its string representation. + * @param name a name to look for + * @return the corresponding TrafficViewEnrollmentStatus + */ + @JsonCreator + public static TrafficViewEnrollmentStatus fromString(String name) { + return fromString(name, TrafficViewEnrollmentStatus.class); + } + + /** + * @return known TrafficViewEnrollmentStatus values + */ + public static Collection values() { + return values(TrafficViewEnrollmentStatus.class); + } +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/EndpointInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/EndpointInner.java index cd654b8a79e..43368d11a31 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/EndpointInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/EndpointInner.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.trafficmanager.EndpointStatus; import com.microsoft.azure.management.trafficmanager.EndpointMonitorStatus; import java.util.List; +import com.microsoft.azure.management.trafficmanager.EndpointPropertiesCustomHeadersItem; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -27,8 +28,9 @@ public class EndpointInner extends ProxyResourceInner { private String targetResourceId; /** - * The fully-qualified DNS name of the endpoint. Traffic Manager returns - * this value in DNS responses to direct traffic to this endpoint. + * The fully-qualified DNS name or IP address of the endpoint. Traffic + * Manager returns this value in DNS responses to direct traffic to this + * endpoint. */ @JsonProperty(value = "properties.target") private String target; @@ -89,6 +91,12 @@ public class EndpointInner extends ProxyResourceInner { @JsonProperty(value = "properties.geoMapping") private List geoMapping; + /** + * List of custom headers. + */ + @JsonProperty(value = "properties.customHeaders") + private List customHeaders; + /** * Get the targetResourceId value. * @@ -269,4 +277,24 @@ public EndpointInner withGeoMapping(List geoMapping) { return this; } + /** + * Get the customHeaders value. + * + * @return the customHeaders value + */ + public List customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders value. + * + * @param customHeaders the customHeaders value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withCustomHeaders(List customHeaders) { + this.customHeaders = customHeaders; + return this; + } + } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/GeographicHierarchiesInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/GeographicHierarchiesInner.java index 672f98429d7..01a1be44ffa 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/GeographicHierarchiesInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/GeographicHierarchiesInner.java @@ -50,7 +50,7 @@ public GeographicHierarchiesInner(Retrofit retrofit, TrafficManagerManagementCli * used by Retrofit to perform actually REST calls. */ interface GeographicHierarchiesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.GeographicHierarchies getRoot" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.GeographicHierarchies getDefault" }) @GET("providers/Microsoft.Network/trafficManagerGeographicHierarchies/default") Observable> getDefault(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapModelInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapModelInner.java new file mode 100644 index 00000000000..1fe9aa44e0f --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapModelInner.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.HeatMapEndpoint; +import com.microsoft.azure.management.trafficmanager.TrafficFlow; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Class representing a Traffic Manager HeatMap. + */ +@JsonFlatten +public class HeatMapModelInner extends ProxyResourceInner { + /** + * The beginning of the time window for this HeatMap, inclusive. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The ending of the time window for this HeatMap, exclusive. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * The endpoints used in this HeatMap calculation. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /** + * The traffic flows produced in this HeatMap calculation. + */ + @JsonProperty(value = "properties.trafficFlows") + private List trafficFlows; + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime value. + * + * @param startTime the startTime value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime value. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime value. + * + * @param endTime the endTime value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the endpoints value. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints value. + * + * @param endpoints the endpoints value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the trafficFlows value. + * + * @return the trafficFlows value + */ + public List trafficFlows() { + return this.trafficFlows; + } + + /** + * Set the trafficFlows value. + * + * @param trafficFlows the trafficFlows value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withTrafficFlows(List trafficFlows) { + this.trafficFlows = trafficFlows; + return this; + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapsInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapsInner.java new file mode 100644 index 00000000000..284d844c59b --- /dev/null +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/HeatMapsInner.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HeatMaps. + */ +public class HeatMapsInner { + /** The Retrofit service to perform REST calls. */ + private HeatMapsService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of HeatMapsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeatMapsInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(HeatMapsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HeatMaps to be + * used by Retrofit to perform actually REST calls. + */ + interface HeatMapsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.HeatMaps get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("heatMapType") String heatMapType, @Query("topLeft") String topLeft, @Query("botRight") String botRight, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HeatMapModelInner object if successful. + */ + public HeatMapModelInner get(String resourceGroupName, String profileName) { + return getWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HeatMapModelInner object + */ + public Observable getAsync(String resourceGroupName, String profileName) { + return getWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, HeatMapModelInner>() { + @Override + public HeatMapModelInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HeatMapModelInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String heatMapType = "default"; + final List topLeft = null; + final List botRight = null; + String topLeftConverted = this.client.serializerAdapter().serializeList(topLeft, CollectionFormat.CSV);String botRightConverted = this.client.serializerAdapter().serializeList(botRight, CollectionFormat.CSV); + return service.get(this.client.subscriptionId(), resourceGroupName, profileName, heatMapType, topLeftConverted, botRightConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param topLeft The top left latitude,longitude pair of the rectangular viewport to query for. + * @param botRight The bottom right latitude,longitude pair of the rectangular viewport to query for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HeatMapModelInner object if successful. + */ + public HeatMapModelInner get(String resourceGroupName, String profileName, List topLeft, List botRight) { + return getWithServiceResponseAsync(resourceGroupName, profileName, topLeft, botRight).toBlocking().single().body(); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param topLeft The top left latitude,longitude pair of the rectangular viewport to query for. + * @param botRight The bottom right latitude,longitude pair of the rectangular viewport to query for. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, List topLeft, List botRight, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, topLeft, botRight), serviceCallback); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param topLeft The top left latitude,longitude pair of the rectangular viewport to query for. + * @param botRight The bottom right latitude,longitude pair of the rectangular viewport to query for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HeatMapModelInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, List topLeft, List botRight) { + return getWithServiceResponseAsync(resourceGroupName, profileName, topLeft, botRight).map(new Func1, HeatMapModelInner>() { + @Override + public HeatMapModelInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets latest heatmap for Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param topLeft The top left latitude,longitude pair of the rectangular viewport to query for. + * @param botRight The bottom right latitude,longitude pair of the rectangular viewport to query for. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HeatMapModelInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, List topLeft, List botRight) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (profileName == null) { + throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(topLeft); + Validator.validate(botRight); + final String heatMapType = "default"; + String topLeftConverted = this.client.serializerAdapter().serializeList(topLeft, CollectionFormat.CSV);String botRightConverted = this.client.serializerAdapter().serializeList(botRight, CollectionFormat.CSV); + return service.get(this.client.subscriptionId(), resourceGroupName, profileName, heatMapType, topLeftConverted, botRightConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfileInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfileInner.java index fcd9589f309..4c3261f3992 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfileInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfileInner.java @@ -8,12 +8,12 @@ package com.microsoft.azure.management.trafficmanager.implementation; -import com.microsoft.azure.Resource; import com.microsoft.azure.management.trafficmanager.ProfileStatus; import com.microsoft.azure.management.trafficmanager.TrafficRoutingMethod; import com.microsoft.azure.management.trafficmanager.DnsConfig; import com.microsoft.azure.management.trafficmanager.MonitorConfig; import java.util.List; +import com.microsoft.azure.management.trafficmanager.TrafficViewEnrollmentStatus; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -21,7 +21,7 @@ * Class representing a Traffic Manager profile. */ @JsonFlatten -public class ProfileInner extends Resource { +public class ProfileInner extends TrackedResourceInner { /** * The status of the Traffic Manager profile. Possible values include: * 'Enabled', 'Disabled'. @@ -54,6 +54,15 @@ public class ProfileInner extends Resource { @JsonProperty(value = "properties.endpoints") private List endpoints; + /** + * Indicates whether Traffic View is 'Enabled' or 'Disabled' for the + * Traffic Manager profile. Null, indicates 'Disabled'. Enabling this + * feature will increase the cost of the Traffic Manage profile. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.trafficViewEnrollmentStatus") + private TrafficViewEnrollmentStatus trafficViewEnrollmentStatus; + /** * Get the profileStatus value. * @@ -154,4 +163,24 @@ public ProfileInner withEndpoints(List endpoints) { return this; } + /** + * Get the trafficViewEnrollmentStatus value. + * + * @return the trafficViewEnrollmentStatus value + */ + public TrafficViewEnrollmentStatus trafficViewEnrollmentStatus() { + return this.trafficViewEnrollmentStatus; + } + + /** + * Set the trafficViewEnrollmentStatus value. + * + * @param trafficViewEnrollmentStatus the trafficViewEnrollmentStatus value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withTrafficViewEnrollmentStatus(TrafficViewEnrollmentStatus trafficViewEnrollmentStatus) { + this.trafficViewEnrollmentStatus = trafficViewEnrollmentStatus; + return this; + } + } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfilesInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfilesInner.java index e4188b4527b..fac12c374ef 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfilesInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProfilesInner.java @@ -8,14 +8,15 @@ package com.microsoft.azure.management.trafficmanager.implementation; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.trafficmanager.CheckTrafficManagerRelativeDnsNameAvailabilityParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -41,7 +42,7 @@ * An instance of this class provides access to all the operations defined * in Profiles. */ -public class ProfilesInner implements InnerSupportsListing, InnerSupportsGet, InnerSupportsDelete { +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private ProfilesService service; /** The service client containing this operation class. */ @@ -65,7 +66,7 @@ public ProfilesInner(Retrofit retrofit, TrafficManagerManagementClientImpl clien interface ProfilesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.Profiles checkTrafficManagerRelativeDnsNameAvailability" }) @POST("providers/Microsoft.Network/checkTrafficManagerNameAvailability") - Observable> checkTrafficManagerRelativeDnsNameAvailability(@Body CheckTrafficManagerRelativeDnsNameAvailabilityParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> checkTrafficManagerRelativeDnsNameAvailability(@Body CheckTrafficManagerRelativeDnsNameAvailabilityParameters 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.trafficmanager.Profiles listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles") @@ -102,7 +103,7 @@ interface ProfilesService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TrafficManagerNameAvailabilityInner object if successful. */ - public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParametersInner parameters) { + public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); } @@ -114,7 +115,7 @@ public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAva * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); } @@ -125,7 +126,7 @@ public ServiceFuture checkTrafficManagerRel * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TrafficManagerNameAvailabilityInner object */ - public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParametersInner parameters) { + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, TrafficManagerNameAvailabilityInner>() { @Override public TrafficManagerNameAvailabilityInner call(ServiceResponse response) { @@ -141,7 +142,7 @@ public TrafficManagerNameAvailabilityInner call(ServiceResponse> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParametersInner parameters) { + public Observable> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } @@ -174,10 +175,7 @@ private ServiceResponse checkTrafficManager * Lists all Traffic Manager profiles within a resource group. * * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException 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<ProfileInner> object if successful. + * @return the PagedList object if successful. */ public PagedList listByResourceGroup(String resourceGroupName) { PageImpl page = new PageImpl<>(); @@ -196,7 +194,6 @@ public Page nextPage(String nextPageLink) { * * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { @@ -207,7 +204,6 @@ public ServiceFuture> listByResourceGroupAsync(String resourc * Lists all Traffic Manager profiles within a resource group. * * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ProfileInner> object */ public Observable> listByResourceGroupAsync(String resourceGroupName) { @@ -225,7 +221,6 @@ public Page call(ServiceResponse> response) { * Lists all Traffic Manager profiles within a resource group. * * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. - * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ProfileInner> object */ public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { @@ -244,7 +239,11 @@ public Observable>> listByResourceGroupWithSe public Observable>> call(Response response) { try { ServiceResponse> result = listByResourceGroupDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -263,10 +262,7 @@ private ServiceResponse> listByResourceGroupDelegate(Resp /** * Lists all Traffic Manager profiles within a subscription. * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the List<ProfileInner> object if successful. + * @return the PagedList object if successful. */ public PagedList list() { PageImpl page = new PageImpl<>(); @@ -284,7 +280,6 @@ public Page nextPage(String nextPageLink) { * Lists all Traffic Manager profiles within a subscription. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { @@ -294,7 +289,6 @@ public ServiceFuture> listAsync(final ServiceCallback> listAsync() { @@ -311,7 +305,6 @@ public Page call(ServiceResponse> response) { /** * Lists all Traffic Manager profiles within a subscription. * - * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ProfileInner> object */ public Observable>> listWithServiceResponseAsync() { @@ -327,7 +320,11 @@ public Observable>> listWithServiceResponseAs public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProxyResourceInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProxyResourceInner.java index 743b987492b..4437d2aadb8 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProxyResourceInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/ProxyResourceInner.java @@ -9,26 +9,28 @@ package com.microsoft.azure.management.trafficmanager.implementation; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; /** * The resource model definition for a ARM proxy resource. It will have * everything other than required location and tags. */ -public class ProxyResourceInner { +public class ProxyResourceInner extends ProxyResource { /** - * Gets or sets the ID. + * Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}. */ @JsonProperty(value = "id") private String id; /** - * Gets or sets the name. + * The name of the resource. */ @JsonProperty(value = "name") private String name; /** - * Gets or sets the type. + * The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. */ @JsonProperty(value = "type") private String type; @@ -92,4 +94,5 @@ public ProxyResourceInner withType(String type) { this.type = type; return this; } + } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrackedResourceInner.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrackedResourceInner.java index 9c537ce38b0..6170cbd762f 100644 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrackedResourceInner.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrackedResourceInner.java @@ -10,12 +10,12 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.Resource; +import com.microsoft.azure.ProxyResource; /** * The resource model definition for a ARM tracked top level resource. */ -public class TrackedResourceInner extends Resource { +public class TrackedResourceInner extends ProxyResource { /** * Resource tags. */ @@ -28,6 +28,25 @@ public class TrackedResourceInner extends Resource { @JsonProperty(value = "location") private String location; + /** + * Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. + */ + @JsonProperty(value = "type") + private String type; + /** * Get the tags value. * @@ -68,4 +87,64 @@ public TrackedResourceInner withLocation(String location) { return this; } + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withType(String type) { + this.type = type; + return this; + } + } diff --git a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerManagementClientImpl.java b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerManagementClientImpl.java index 8b102ea3934..b32cb07a639 100755 --- a/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerManagementClientImpl.java +++ b/azure-mgmt-trafficmanager/src/main/java/com/microsoft/azure/management/trafficmanager/implementation/TrafficManagerManagementClientImpl.java @@ -171,6 +171,19 @@ public GeographicHierarchiesInner geographicHierarchies() { return this.geographicHierarchies; } + /** + * The HeatMapsInner object to access its operations. + */ + private HeatMapsInner heatMaps; + + /** + * Gets the HeatMapsInner object to access its operations. + * @return the HeatMapsInner object. + */ + public HeatMapsInner heatMaps() { + return this.heatMaps; + } + /** * Initializes an instance of TrafficManagerManagementClient client. * @@ -202,13 +215,14 @@ public TrafficManagerManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2017-05-01"; + this.apiVersion = "2018-03-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.endpoints = new EndpointsInner(restClient().retrofit(), this); this.profiles = new ProfilesInner(restClient().retrofit(), this); this.geographicHierarchies = new GeographicHierarchiesInner(restClient().retrofit(), this); + this.heatMaps = new HeatMapsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -219,6 +233,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2017-05-01"); + return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2018-03-01"); } }