diff --git a/trafficmanager/resource-manager/v2015_11_01/pom.xml b/trafficmanager/resource-manager/v2015_11_01/pom.xml new file mode 100644 index 000000000000..4fb394ada720 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.trafficmanager.v2015_11_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java new file mode 100644 index 000000000000..36004a6e9fac --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/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.v2015_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to check Traffic Manager name operation. + */ +public class CheckTrafficManagerRelativeDnsNameAvailabilityParameters { + /** + * Gets or sets the name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get gets or sets the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the name of the resource. + * + * @param name the name value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets the type of the resource. + * + * @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/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/DnsConfig.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/DnsConfig.java new file mode 100644 index 000000000000..0958c9adf991 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/DnsConfig.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing DNS settings in a Traffic Manager profile. + */ +public class DnsConfig { + /** + * Gets or sets the relative DNS name provided by this Traffic Manager + * profile. This value is combined with the DNS domain name used by Azure + * Traffic Manager to form the fully-qualified domain name (FQDN) of the + * profile. + */ + @JsonProperty(value = "relativeName") + private String relativeName; + + /** + * Gets or sets the fully-qualified domain name (FQDN) of the Traffic + * Manager profile. This is formed from the concatenation of the + * RelativeName with the DNS domain used by Azure Traffic Manager. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the + * local DNS resolvers and DNS clients how long to cache DNS responses + * provided by this Traffic Manager profile. + */ + @JsonProperty(value = "ttl") + private Long ttl; + + /** + * Get gets or sets the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @return the relativeName value + */ + public String relativeName() { + return this.relativeName; + } + + /** + * Set gets or sets the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @param relativeName the relativeName value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withRelativeName(String relativeName) { + this.relativeName = relativeName; + return this; + } + + /** + * Get gets or sets the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set gets or sets the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @param fqdn the fqdn value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @return the ttl value + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @param ttl the ttl value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoint.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoint.java new file mode 100644 index 000000000000..cc2563dfcdd7 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoint.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.EndpointInner; + +/** + * Type representing Endpoint. + */ +public interface Endpoint extends HasInner, HasManager { + /** + * @return the endpointLocation value. + */ + String endpointLocation(); + + /** + * @return the endpointMonitorStatus value. + */ + String endpointMonitorStatus(); + + /** + * @return the endpointStatus value. + */ + String endpointStatus(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minChildEndpoints value. + */ + Long minChildEndpoints(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Long priority(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the weight value. + */ + Long weight(); + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoints.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoints.java new file mode 100644 index 000000000000..29be1c6e6e06 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Endpoints.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.EndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Endpoints. + */ +public interface Endpoints extends HasInner { + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/MonitorConfig.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/MonitorConfig.java new file mode 100644 index 000000000000..1aeb1322352f --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/MonitorConfig.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing endpoint monitoring settings in a Traffic Manager profile. + */ +public class MonitorConfig { + /** + * Gets or sets the profile-level monitoring status of the Traffic Manager + * profile. + */ + @JsonProperty(value = "profileMonitorStatus") + private String profileMonitorStatus; + + /** + * Gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint + * health. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * Gets or sets the TCP port used to probe for endpoint health. + */ + @JsonProperty(value = "port") + private Long port; + + /** + * Gets or sets the path relative to the endpoint domain name used to probe + * for endpoint health. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get gets or sets the profile-level monitoring status of the Traffic Manager profile. + * + * @return the profileMonitorStatus value + */ + public String profileMonitorStatus() { + return this.profileMonitorStatus; + } + + /** + * Set gets or sets the profile-level monitoring status of the Traffic Manager profile. + * + * @param profileMonitorStatus the profileMonitorStatus value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProfileMonitorStatus(String profileMonitorStatus) { + this.profileMonitorStatus = profileMonitorStatus; + return this; + } + + /** + * Get gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint health. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint health. + * + * @param protocol the protocol value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get gets or sets the TCP port used to probe for endpoint health. + * + * @return the port value + */ + public Long port() { + return this.port; + } + + /** + * Set gets or sets the TCP port used to probe for endpoint health. + * + * @param port the port value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPort(Long port) { + this.port = port; + return this; + } + + /** + * Get gets or sets the path relative to the endpoint domain name used to probe for endpoint health. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set gets or sets the path relative to the endpoint domain name used to probe for endpoint health. + * + * @param path the path value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profile.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profile.java new file mode 100644 index 000000000000..af88fd4bc1e4 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profile.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.ProfileInner; + +/** + * Type representing Profile. + */ +public interface Profile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsConfig value. + */ + DnsConfig dnsConfig(); + + /** + * @return the endpoints value. + */ + List endpoints(); + + /** + * @return the monitorConfig value. + */ + MonitorConfig monitorConfig(); + + /** + * @return the profileStatus value. + */ + String profileStatus(); + + /** + * @return the trafficRoutingMethod value. + */ + String trafficRoutingMethod(); + + /** + * The entirety of the Profile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Profile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Profile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Profile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the profile update allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + WithCreate withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile update allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + WithCreate withEndpoints(List endpoints); + } + + /** + * The stage of the profile update allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + WithCreate withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile update allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + WithCreate withProfileStatus(String profileStatus); + } + + /** + * The stage of the profile update allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + WithCreate withTrafficRoutingMethod(String trafficRoutingMethod); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsConfig, DefinitionStages.WithEndpoints, DefinitionStages.WithMonitorConfig, DefinitionStages.WithProfileStatus, DefinitionStages.WithTrafficRoutingMethod { + } + } + /** + * The template for a Profile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsConfig, UpdateStages.WithEndpoints, UpdateStages.WithMonitorConfig, UpdateStages.WithProfileStatus, UpdateStages.WithTrafficRoutingMethod { + } + + /** + * Grouping of Profile update stages. + */ + interface UpdateStages { + /** + * The stage of the profile {0} allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + Update withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile {0} allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + Update withEndpoints(List endpoints); + } + + /** + * The stage of the profile {0} allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + Update withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile {0} allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + Update withProfileStatus(String profileStatus); + } + + /** + * The stage of the profile {0} allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + Update withTrafficRoutingMethod(String trafficRoutingMethod); + } + + } +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profiles.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profiles.java new file mode 100644 index 000000000000..cfa1f9fc400a --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/Profiles.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.trafficmanager.v2015_11_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.ProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Profiles. + */ +public interface Profiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters); + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/TrafficManagerNameAvailability.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/TrafficManagerNameAvailability.java new file mode 100644 index 000000000000..cdf2dc0ee482 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/TrafficManagerNameAvailability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation.TrafficManagerNameAvailabilityInner; + +/** + * Type representing TrafficManagerNameAvailability. + */ +public interface TrafficManagerNameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointImpl.java new file mode 100644 index 000000000000..4eef65b264ea --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoint; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EndpointImpl extends WrapperImpl implements Endpoint { + private final NetworkManager manager; + EndpointImpl(EndpointInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String endpointLocation() { + return this.inner().endpointLocation(); + } + + @Override + public String endpointMonitorStatus() { + return this.inner().endpointMonitorStatus(); + } + + @Override + public String endpointStatus() { + return this.inner().endpointStatus(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long minChildEndpoints() { + return this.inner().minChildEndpoints(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long priority() { + return this.inner().priority(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long weight() { + return this.inner().weight(); + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointInner.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointInner.java new file mode 100644 index 000000000000..fc9294d77509 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointInner.java @@ -0,0 +1,318 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2015_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Class representing a Traffic Manager endpoint. + */ +@JsonFlatten +public class EndpointInner { + /** + * Gets or sets the ID of the Traffic Manager endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets the name of the Traffic Manager endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the endpoint type of the Traffic Manager endpoint. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets the Azure Resource URI of the of the endpoint. Not + * applicable to endpoints of type 'ExternalEndpoints'. + */ + @JsonProperty(value = "properties.targetResourceId") + private String targetResourceId; + + /** + * Gets or sets the fully-qualified DNS name of the endpoint. Traffic + * Manager returns this value in DNS responses to direct traffic to this + * endpoint. + */ + @JsonProperty(value = "properties.target") + private String target; + + /** + * Gets or sets the status of the endpoint.. If the endpoint is Enabled, + * it is probed for endpoint health and is included in the traffic routing + * method. Possible values are 'Enabled' and 'Disabled'. + */ + @JsonProperty(value = "properties.endpointStatus") + private String endpointStatus; + + /** + * Gets or sets the weight of this endpoint when using the 'Weighted' + * traffic routing method. Possible values are from 1 to 1000. + */ + @JsonProperty(value = "properties.weight") + private Long weight; + + /** + * Gets or sets the priority of this endpoint when using the ‘Priority’ + * traffic routing method. Possible values are from 1 to 1000, lower values + * represent higher priority. This is an optional parameter. If specified, + * it must be specified on all endpoints, and no two endpoints can share + * the same priority value. + */ + @JsonProperty(value = "properties.priority") + private Long priority; + + /** + * Specifies the location of the external or nested endpoints when using + * the ‘Performance’ traffic routing method. + */ + @JsonProperty(value = "properties.endpointLocation") + private String endpointLocation; + + /** + * Gets or sets the monitoring status of the endpoint. + */ + @JsonProperty(value = "properties.endpointMonitorStatus") + private String endpointMonitorStatus; + + /** + * Gets or sets the minimum number of endpoints that must be available in + * the child profile in order for the parent profile to be considered + * available. Only applicable to endpoint of type 'NestedEndpoints'. + */ + @JsonProperty(value = "properties.minChildEndpoints") + private Long minChildEndpoints; + + /** + * Get gets or sets the ID of the Traffic Manager endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the ID of the Traffic Manager endpoint. + * + * @param id the id value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets the name of the Traffic Manager endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the name of the Traffic Manager endpoint. + * + * @param name the name value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets the endpoint type of the Traffic Manager endpoint. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets the endpoint type of the Traffic Manager endpoint. + * + * @param type the type value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set gets or sets the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @param targetResourceId the targetResourceId value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get gets or sets the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set gets or sets the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @param target the target value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get gets or sets the status of the endpoint.. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values are 'Enabled' and 'Disabled'. + * + * @return the endpointStatus value + */ + public String endpointStatus() { + return this.endpointStatus; + } + + /** + * Set gets or sets the status of the endpoint.. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values are 'Enabled' and 'Disabled'. + * + * @param endpointStatus the endpointStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointStatus(String endpointStatus) { + this.endpointStatus = endpointStatus; + return this; + } + + /** + * Get gets or sets the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @return the weight value + */ + public Long weight() { + return this.weight; + } + + /** + * Set gets or sets the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @param weight the weight value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withWeight(Long weight) { + this.weight = weight; + return this; + } + + /** + * Get gets or sets the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @return the priority value + */ + public Long priority() { + return this.priority; + } + + /** + * Set gets or sets the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @param priority the priority value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withPriority(Long priority) { + this.priority = priority; + return this; + } + + /** + * Get specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @return the endpointLocation value + */ + public String endpointLocation() { + return this.endpointLocation; + } + + /** + * Set specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @param endpointLocation the endpointLocation value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointLocation(String endpointLocation) { + this.endpointLocation = endpointLocation; + return this; + } + + /** + * Get gets or sets the monitoring status of the endpoint. + * + * @return the endpointMonitorStatus value + */ + public String endpointMonitorStatus() { + return this.endpointMonitorStatus; + } + + /** + * Set gets or sets the monitoring status of the endpoint. + * + * @param endpointMonitorStatus the endpointMonitorStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointMonitorStatus(String endpointMonitorStatus) { + this.endpointMonitorStatus = endpointMonitorStatus; + return this; + } + + /** + * Get gets or sets the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @return the minChildEndpoints value + */ + public Long minChildEndpoints() { + return this.minChildEndpoints; + } + + /** + * Set gets or sets the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @param minChildEndpoints the minChildEndpoints value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withMinChildEndpoints(Long minChildEndpoints) { + this.minChildEndpoints = minChildEndpoints; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsImpl.java new file mode 100644 index 000000000000..650335a44ef6 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoints; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoint; + +class EndpointsImpl extends WrapperImpl implements Endpoints { + private final NetworkManager manager; + + EndpointsImpl(NetworkManager manager) { + super(manager.inner().endpoints()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.updateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, profileName, endpointType, endpointName).toCompletable(); + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsInner.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsInner.java new file mode 100644 index 000000000000..0b28628bb71c --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/EndpointsInner.java @@ -0,0 +1,494 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2015_11_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Endpoints. + */ +public class EndpointsInner { + /** The Retrofit service to perform REST calls. */ + private EndpointsService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of EndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EndpointsInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(EndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Endpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface EndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2015_11_01.Endpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @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.trafficmanager.v2015_11_01.Endpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2015_11_01.Endpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner update(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner get(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), 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); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner createOrUpdate(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String profileName, String endpointType, String endpointName) { + deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/IdParsingUtils.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..4ec12118c9aa --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/NetworkManager.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/NetworkManager.java new file mode 100644 index 000000000000..8bd2d6c8f7b8 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/NetworkManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoints; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Profiles; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private Endpoints endpoints; + private Profiles profiles; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(this); + } + return this.endpoints; + } + + /** + * @return Entry point to manage Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(this); + } + return this.profiles; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new TrafficManagerManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/PageImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/PageImpl.java new file mode 100644 index 000000000000..2d583ce886ef --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileImpl.java new file mode 100644 index 000000000000..e3d470992265 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2015_11_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Profile; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.MonitorConfig; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Endpoint; + +class ProfileImpl extends GroupableResourceCoreImpl implements Profile, Profile.Definition, Profile.Update { + ProfileImpl(String name, ProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DnsConfig dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public List endpoints() { + List lst = new ArrayList(); + if (this.inner().endpoints() != null) { + for (EndpointInner inner : this.inner().endpoints()) { + lst.add( new EndpointImpl(inner, manager())); + } + } + return lst; + } + + @Override + public MonitorConfig monitorConfig() { + return this.inner().monitorConfig(); + } + + @Override + public String profileStatus() { + return this.inner().profileStatus(); + } + + @Override + public String trafficRoutingMethod() { + return this.inner().trafficRoutingMethod(); + } + + @Override + public ProfileImpl withDnsConfig(DnsConfig dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ProfileImpl withEndpoints(List endpoints) { + this.inner().withEndpoints(endpoints); + return this; + } + + @Override + public ProfileImpl withMonitorConfig(MonitorConfig monitorConfig) { + this.inner().withMonitorConfig(monitorConfig); + return this; + } + + @Override + public ProfileImpl withProfileStatus(String profileStatus) { + this.inner().withProfileStatus(profileStatus); + return this; + } + + @Override + public ProfileImpl withTrafficRoutingMethod(String trafficRoutingMethod) { + this.inner().withTrafficRoutingMethod(trafficRoutingMethod); + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileInner.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileInner.java new file mode 100644 index 000000000000..3fbb1a65ca83 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfileInner.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2015_11_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.MonitorConfig; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Class representing a Traffic Manager profile. + */ +@JsonFlatten +@SkipParentValidation +public class ProfileInner extends Resource { + /** + * Gets or sets the status of the Traffic Manager profile. Possible values + * are 'Enabled' and 'Disabled'. + */ + @JsonProperty(value = "properties.profileStatus") + private String profileStatus; + + /** + * Gets or sets the traffic routing method of the Traffic Manager profile. + * Possible values are 'Performance', 'Weighted', or 'Priority'. + */ + @JsonProperty(value = "properties.trafficRoutingMethod") + private String trafficRoutingMethod; + + /** + * Gets or sets the DNS settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfig dnsConfig; + + /** + * Gets or sets the endpoint monitoring settings of the Traffic Manager + * profile. + */ + @JsonProperty(value = "properties.monitorConfig") + private MonitorConfig monitorConfig; + + /** + * Gets or sets the list of endpoints in the Traffic Manager profile. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /** + * Get gets or sets the status of the Traffic Manager profile. Possible values are 'Enabled' and 'Disabled'. + * + * @return the profileStatus value + */ + public String profileStatus() { + return this.profileStatus; + } + + /** + * Set gets or sets the status of the Traffic Manager profile. Possible values are 'Enabled' and 'Disabled'. + * + * @param profileStatus the profileStatus value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withProfileStatus(String profileStatus) { + this.profileStatus = profileStatus; + return this; + } + + /** + * Get gets or sets the traffic routing method of the Traffic Manager profile. Possible values are 'Performance', 'Weighted', or 'Priority'. + * + * @return the trafficRoutingMethod value + */ + public String trafficRoutingMethod() { + return this.trafficRoutingMethod; + } + + /** + * Set gets or sets the traffic routing method of the Traffic Manager profile. Possible values are 'Performance', 'Weighted', or 'Priority'. + * + * @param trafficRoutingMethod the trafficRoutingMethod value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withTrafficRoutingMethod(String trafficRoutingMethod) { + this.trafficRoutingMethod = trafficRoutingMethod; + return this; + } + + /** + * Get gets or sets the DNS settings of the Traffic Manager profile. + * + * @return the dnsConfig value + */ + public DnsConfig dnsConfig() { + return this.dnsConfig; + } + + /** + * Set gets or sets the DNS settings of the Traffic Manager profile. + * + * @param dnsConfig the dnsConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withDnsConfig(DnsConfig dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get gets or sets the endpoint monitoring settings of the Traffic Manager profile. + * + * @return the monitorConfig value + */ + public MonitorConfig monitorConfig() { + return this.monitorConfig; + } + + /** + * Set gets or sets the endpoint monitoring settings of the Traffic Manager profile. + * + * @param monitorConfig the monitorConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withMonitorConfig(MonitorConfig monitorConfig) { + this.monitorConfig = monitorConfig; + return this; + } + + /** + * Get gets or sets the list of endpoints in the Traffic Manager profile. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set gets or sets the list of endpoints in the Traffic Manager profile. + * + * @param endpoints the endpoints value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesImpl.java new file mode 100644 index 000000000000..7f4fbcdc8b9f --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.Profile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.TrafficManagerNameAvailability; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.CheckTrafficManagerRelativeDnsNameAvailabilityParameters; + +class ProfilesImpl extends GroupableResourcesCoreImpl implements Profiles { + protected ProfilesImpl(NetworkManager manager) { + super(manager.inner().profiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ProfilesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + ProfilesInner client = this.inner(); + return client.checkTrafficManagerRelativeDnsNameAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public TrafficManagerNameAvailability call(TrafficManagerNameAvailabilityInner inner) { + return new TrafficManagerNameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + protected ProfileImpl wrapModel(ProfileInner inner) { + return new ProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected ProfileImpl wrapModel(String name) { + return new ProfileImpl(name, new ProfileInner(), this.manager()); + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesInner.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesInner.java new file mode 100644 index 000000000000..d0315a5fa404 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/ProfilesInner.java @@ -0,0 +1,704 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2015_11_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.trafficmanager.v2015_11_01.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; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Profiles. + */ +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ProfilesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of ProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProfilesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(ProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Profiles to be + * used by Retrofit to perform actually REST calls. + */ + interface ProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2015_11_01.Profiles checkTrafficManagerRelativeDnsNameAvailability" }) + @POST("providers/Microsoft.Network/checkTrafficManagerNameAvailability") + 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.v2015_11_01.Profiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2015_11_01.Profiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2015_11_01.Profiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2015_11_01.Profiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner 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.v2015_11_01.Profiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2015_11_01.Profiles update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerNameAvailabilityInner object if successful. + */ + public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, TrafficManagerNameAvailabilityInner>() { + @Override + public TrafficManagerNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkTrafficManagerRelativeDnsNameAvailability(parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkTrafficManagerRelativeDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkTrafficManagerRelativeDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the observable to the List<ProfileInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 ProfileInner object if successful. + */ + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 getByResourceGroupAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner createOrUpdate(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String profileName) { + deleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerManagementClientImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerManagementClientImpl.java new file mode 100644 index 000000000000..0a4a857c5b1c --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the TrafficManagerManagementClientImpl class. + */ +public class TrafficManagerManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The EndpointsInner object to access its operations. + */ + private EndpointsInner endpoints; + + /** + * Gets the EndpointsInner object to access its operations. + * @return the EndpointsInner object. + */ + public EndpointsInner endpoints() { + return this.endpoints; + } + + /** + * The ProfilesInner object to access its operations. + */ + private ProfilesInner profiles; + + /** + * Gets the ProfilesInner object to access its operations. + * @return the ProfilesInner object. + */ + public ProfilesInner profiles() { + return this.profiles; + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public TrafficManagerManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-11-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.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2015-11-01"); + } +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityImpl.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityImpl.java new file mode 100644 index 000000000000..667bfcf69dc7 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2015_11_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2015_11_01.TrafficManagerNameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TrafficManagerNameAvailabilityImpl extends WrapperImpl implements TrafficManagerNameAvailability { + private final NetworkManager manager; + TrafficManagerNameAvailabilityImpl(TrafficManagerNameAvailabilityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityInner.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityInner.java new file mode 100644 index 000000000000..e7287fab6421 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/TrafficManagerNameAvailabilityInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager Name Availability response. + */ +public class TrafficManagerNameAvailabilityInner { + /** + * The relative name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Traffic Manager profile resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Describes whether the relative name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, when applicable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Descriptive message that explains why the name is not available, when + * applicable. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the relative name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the relative name. + * + * @param name the name value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get traffic Manager profile resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set traffic Manager profile resource type. + * + * @param type the type value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get describes whether the relative name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set describes whether the relative name is available or not. + * + * @param nameAvailable the nameAvailable value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, when applicable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, when applicable. + * + * @param reason the reason value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get descriptive message that explains why the name is not available, when applicable. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set descriptive message that explains why the name is not available, when applicable. + * + * @param message the message value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/package-info.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/package-info.java new file mode 100644 index 000000000000..8eeef5983261 --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2015_11_01.implementation; diff --git a/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/package-info.java b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/package-info.java new file mode 100644 index 000000000000..f7d0b6ec5b9d --- /dev/null +++ b/trafficmanager/resource-manager/v2015_11_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2015_11_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2015_11_01; diff --git a/trafficmanager/resource-manager/v2017_03_01/pom.xml b/trafficmanager/resource-manager/v2017_03_01/pom.xml new file mode 100644 index 000000000000..ca09ba9c845a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.trafficmanager.v2017_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java new file mode 100644 index 000000000000..ecd41a56548e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/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.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to check Traffic Manager name operation. + */ +public class CheckTrafficManagerRelativeDnsNameAvailabilityParameters { + /** + * Gets or sets the name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get gets or sets the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the name of the resource. + * + * @param name the name value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets the type of the resource. + * + * @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/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DeleteOperationResult.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DeleteOperationResult.java new file mode 100644 index 000000000000..3d2c7d412c9b --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DeleteOperationResult.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.DeleteOperationResultInner; + +/** + * Type representing DeleteOperationResult. + */ +public interface DeleteOperationResult extends HasInner, HasManager { + /** + * @return the operationResult value. + */ + Boolean operationResult(); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DnsConfig.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DnsConfig.java new file mode 100644 index 000000000000..41923e69ffb8 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/DnsConfig.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing DNS settings in a Traffic Manager profile. + */ +public class DnsConfig { + /** + * Gets or sets the relative DNS name provided by this Traffic Manager + * profile. This value is combined with the DNS domain name used by Azure + * Traffic Manager to form the fully-qualified domain name (FQDN) of the + * profile. + */ + @JsonProperty(value = "relativeName") + private String relativeName; + + /** + * Gets or sets the fully-qualified domain name (FQDN) of the Traffic + * Manager profile. This is formed from the concatenation of the + * RelativeName with the DNS domain used by Azure Traffic Manager. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the + * local DNS resolvers and DNS clients how long to cache DNS responses + * provided by this Traffic Manager profile. + */ + @JsonProperty(value = "ttl") + private Long ttl; + + /** + * Get gets or sets the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @return the relativeName value + */ + public String relativeName() { + return this.relativeName; + } + + /** + * Set gets or sets the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @param relativeName the relativeName value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withRelativeName(String relativeName) { + this.relativeName = relativeName; + return this; + } + + /** + * Get gets or sets the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set gets or sets the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @param fqdn the fqdn value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @return the ttl value + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set gets or sets the DNS Ttime-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @param ttl the ttl value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoint.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoint.java new file mode 100644 index 000000000000..41bfc3897b20 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoint.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.EndpointInner; +import java.util.List; + +/** + * Type representing Endpoint. + */ +public interface Endpoint extends HasInner, HasManager { + /** + * @return the endpointLocation value. + */ + String endpointLocation(); + + /** + * @return the endpointMonitorStatus value. + */ + String endpointMonitorStatus(); + + /** + * @return the endpointStatus value. + */ + String endpointStatus(); + + /** + * @return the geoMapping value. + */ + List geoMapping(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minChildEndpoints value. + */ + Long minChildEndpoints(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Long priority(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the weight value. + */ + Long weight(); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoints.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoints.java new file mode 100644 index 000000000000..1f8f68a1b59e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Endpoints.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.EndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Endpoints. + */ +public interface Endpoints extends HasInner { + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/GeographicHierarchies.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/GeographicHierarchies.java new file mode 100644 index 000000000000..64f3e3592207 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/GeographicHierarchies.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.GeographicHierarchiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GeographicHierarchies. + */ +public interface GeographicHierarchies extends HasInner { + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultAsync(); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/MonitorConfig.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/MonitorConfig.java new file mode 100644 index 000000000000..46a82573eeef --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/MonitorConfig.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing endpoint monitoring settings in a Traffic Manager profile. + */ +public class MonitorConfig { + /** + * Gets or sets the profile-level monitoring status of the Traffic Manager + * profile. + */ + @JsonProperty(value = "profileMonitorStatus") + private String profileMonitorStatus; + + /** + * Gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint + * health. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * Gets or sets the TCP port used to probe for endpoint health. + */ + @JsonProperty(value = "port") + private Long port; + + /** + * Gets or sets the path relative to the endpoint domain name used to probe + * for endpoint health. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get gets or sets the profile-level monitoring status of the Traffic Manager profile. + * + * @return the profileMonitorStatus value + */ + public String profileMonitorStatus() { + return this.profileMonitorStatus; + } + + /** + * Set gets or sets the profile-level monitoring status of the Traffic Manager profile. + * + * @param profileMonitorStatus the profileMonitorStatus value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProfileMonitorStatus(String profileMonitorStatus) { + this.profileMonitorStatus = profileMonitorStatus; + return this; + } + + /** + * Get gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint health. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint health. + * + * @param protocol the protocol value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get gets or sets the TCP port used to probe for endpoint health. + * + * @return the port value + */ + public Long port() { + return this.port; + } + + /** + * Set gets or sets the TCP port used to probe for endpoint health. + * + * @param port the port value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPort(Long port) { + this.port = port; + return this; + } + + /** + * Get gets or sets the path relative to the endpoint domain name used to probe for endpoint health. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set gets or sets the path relative to the endpoint domain name used to probe for endpoint health. + * + * @param path the path value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profile.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profile.java new file mode 100644 index 000000000000..6060d1710344 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profile.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.ProfileInner; + +/** + * Type representing Profile. + */ +public interface Profile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsConfig value. + */ + DnsConfig dnsConfig(); + + /** + * @return the endpoints value. + */ + List endpoints(); + + /** + * @return the monitorConfig value. + */ + MonitorConfig monitorConfig(); + + /** + * @return the profileStatus value. + */ + String profileStatus(); + + /** + * @return the trafficRoutingMethod value. + */ + String trafficRoutingMethod(); + + /** + * The entirety of the Profile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Profile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Profile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Profile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the profile update allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + WithCreate withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile update allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + WithCreate withEndpoints(List endpoints); + } + + /** + * The stage of the profile update allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + WithCreate withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile update allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + WithCreate withProfileStatus(String profileStatus); + } + + /** + * The stage of the profile update allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + WithCreate withTrafficRoutingMethod(String trafficRoutingMethod); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsConfig, DefinitionStages.WithEndpoints, DefinitionStages.WithMonitorConfig, DefinitionStages.WithProfileStatus, DefinitionStages.WithTrafficRoutingMethod { + } + } + /** + * The template for a Profile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsConfig, UpdateStages.WithEndpoints, UpdateStages.WithMonitorConfig, UpdateStages.WithProfileStatus, UpdateStages.WithTrafficRoutingMethod { + } + + /** + * Grouping of Profile update stages. + */ + interface UpdateStages { + /** + * The stage of the profile {0} allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + Update withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile {0} allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + Update withEndpoints(List endpoints); + } + + /** + * The stage of the profile {0} allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + Update withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile {0} allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + Update withProfileStatus(String profileStatus); + } + + /** + * The stage of the profile {0} allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + Update withTrafficRoutingMethod(String trafficRoutingMethod); + } + + } +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profiles.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profiles.java new file mode 100644 index 000000000000..a4192c798b7f --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Profiles.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.trafficmanager.v2017_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.ProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Profiles. + */ +public interface Profiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Region.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Region.java new file mode 100644 index 000000000000..b76bf6de9580 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/Region.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a region in the Geographic hierarchy used with the + * Geographic traffic routing method. + */ +public class Region { + /** + * The code of the region. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The name of the region. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The list of Regions grouped under this Region in the Geographic + * Hierarchy. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the code of the region. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code of the region. + * + * @param code the code value to set + * @return the Region object itself. + */ + public Region withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the name of the region. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the region. + * + * @param name the name value to set + * @return the Region object itself. + */ + public Region withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @param regions the regions value to set + * @return the Region object itself. + */ + public Region withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerGeographicHierarchy.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerGeographicHierarchy.java new file mode 100644 index 000000000000..44536cc40ddf --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerGeographicHierarchy.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.TrafficManagerGeographicHierarchyInner; +import java.util.Map; + +/** + * Type representing TrafficManagerGeographicHierarchy. + */ +public interface TrafficManagerGeographicHierarchy extends HasInner, HasManager { + /** + * @return the geographicHierarchy value. + */ + Region geographicHierarchy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerNameAvailability.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerNameAvailability.java new file mode 100644 index 000000000000..6c532340b721 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/TrafficManagerNameAvailability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation.TrafficManagerNameAvailabilityInner; + +/** + * Type representing TrafficManagerNameAvailability. + */ +public interface TrafficManagerNameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultImpl.java new file mode 100644 index 000000000000..3c2fbbb7ce4d --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.DeleteOperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DeleteOperationResultImpl extends WrapperImpl implements DeleteOperationResult { + private final NetworkManager manager; + DeleteOperationResultImpl(DeleteOperationResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean operationResult() { + return this.inner().operationResult(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultInner.java new file mode 100644 index 000000000000..884319eff85a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/DeleteOperationResultInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of the request or operation. + */ +public class DeleteOperationResultInner { + /** + * The result of the operation or request. + */ + @JsonProperty(value = "boolean", access = JsonProperty.Access.WRITE_ONLY) + private Boolean operationResult; + + /** + * Get the result of the operation or request. + * + * @return the operationResult value + */ + public Boolean operationResult() { + return this.operationResult; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointImpl.java new file mode 100644 index 000000000000..27c4c24a075e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoint; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class EndpointImpl extends WrapperImpl implements Endpoint { + private final NetworkManager manager; + EndpointImpl(EndpointInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String endpointLocation() { + return this.inner().endpointLocation(); + } + + @Override + public String endpointMonitorStatus() { + return this.inner().endpointMonitorStatus(); + } + + @Override + public String endpointStatus() { + return this.inner().endpointStatus(); + } + + @Override + public List geoMapping() { + return this.inner().geoMapping(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long minChildEndpoints() { + return this.inner().minChildEndpoints(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long priority() { + return this.inner().priority(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long weight() { + return this.inner().weight(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointInner.java new file mode 100644 index 000000000000..9e9f24c52762 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointInner.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Class representing a Traffic Manager endpoint. + */ +@JsonFlatten +public class EndpointInner { + /** + * Gets or sets the ID of the Traffic Manager endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Gets or sets the name of the Traffic Manager endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the endpoint type of the Traffic Manager endpoint. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Gets or sets the Azure Resource URI of the of the endpoint. Not + * applicable to endpoints of type 'ExternalEndpoints'. + */ + @JsonProperty(value = "properties.targetResourceId") + private String targetResourceId; + + /** + * Gets or sets the fully-qualified DNS name of the endpoint. Traffic + * Manager returns this value in DNS responses to direct traffic to this + * endpoint. + */ + @JsonProperty(value = "properties.target") + private String target; + + /** + * Gets or sets the status of the endpoint.. If the endpoint is Enabled, + * it is probed for endpoint health and is included in the traffic routing + * method. Possible values are 'Enabled' and 'Disabled'. + */ + @JsonProperty(value = "properties.endpointStatus") + private String endpointStatus; + + /** + * Gets or sets the weight of this endpoint when using the 'Weighted' + * traffic routing method. Possible values are from 1 to 1000. + */ + @JsonProperty(value = "properties.weight") + private Long weight; + + /** + * Gets or sets the priority of this endpoint when using the ‘Priority’ + * traffic routing method. Possible values are from 1 to 1000, lower values + * represent higher priority. This is an optional parameter. If specified, + * it must be specified on all endpoints, and no two endpoints can share + * the same priority value. + */ + @JsonProperty(value = "properties.priority") + private Long priority; + + /** + * Specifies the location of the external or nested endpoints when using + * the ‘Performance’ traffic routing method. + */ + @JsonProperty(value = "properties.endpointLocation") + private String endpointLocation; + + /** + * Gets or sets the monitoring status of the endpoint. + */ + @JsonProperty(value = "properties.endpointMonitorStatus") + private String endpointMonitorStatus; + + /** + * Gets or sets the minimum number of endpoints that must be available in + * the child profile in order for the parent profile to be considered + * available. Only applicable to endpoint of type 'NestedEndpoints'. + */ + @JsonProperty(value = "properties.minChildEndpoints") + private Long minChildEndpoints; + + /** + * Gets or sets the list of countries/regions mapped to this endpoint when + * using the ‘Geographic’ traffic routing method. Please consult Traffic + * Manager Geographic documentation for a full list of accepted values. + */ + @JsonProperty(value = "properties.geoMapping") + private List geoMapping; + + /** + * Get gets or sets the ID of the Traffic Manager endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets the ID of the Traffic Manager endpoint. + * + * @param id the id value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get gets or sets the name of the Traffic Manager endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the name of the Traffic Manager endpoint. + * + * @param name the name value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets the endpoint type of the Traffic Manager endpoint. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set gets or sets the endpoint type of the Traffic Manager endpoint. + * + * @param type the type value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get gets or sets the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set gets or sets the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @param targetResourceId the targetResourceId value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get gets or sets the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set gets or sets the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @param target the target value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get gets or sets the status of the endpoint.. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values are 'Enabled' and 'Disabled'. + * + * @return the endpointStatus value + */ + public String endpointStatus() { + return this.endpointStatus; + } + + /** + * Set gets or sets the status of the endpoint.. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values are 'Enabled' and 'Disabled'. + * + * @param endpointStatus the endpointStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointStatus(String endpointStatus) { + this.endpointStatus = endpointStatus; + return this; + } + + /** + * Get gets or sets the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @return the weight value + */ + public Long weight() { + return this.weight; + } + + /** + * Set gets or sets the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @param weight the weight value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withWeight(Long weight) { + this.weight = weight; + return this; + } + + /** + * Get gets or sets the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @return the priority value + */ + public Long priority() { + return this.priority; + } + + /** + * Set gets or sets the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @param priority the priority value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withPriority(Long priority) { + this.priority = priority; + return this; + } + + /** + * Get specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @return the endpointLocation value + */ + public String endpointLocation() { + return this.endpointLocation; + } + + /** + * Set specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @param endpointLocation the endpointLocation value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointLocation(String endpointLocation) { + this.endpointLocation = endpointLocation; + return this; + } + + /** + * Get gets or sets the monitoring status of the endpoint. + * + * @return the endpointMonitorStatus value + */ + public String endpointMonitorStatus() { + return this.endpointMonitorStatus; + } + + /** + * Set gets or sets the monitoring status of the endpoint. + * + * @param endpointMonitorStatus the endpointMonitorStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointMonitorStatus(String endpointMonitorStatus) { + this.endpointMonitorStatus = endpointMonitorStatus; + return this; + } + + /** + * Get gets or sets the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @return the minChildEndpoints value + */ + public Long minChildEndpoints() { + return this.minChildEndpoints; + } + + /** + * Set gets or sets the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @param minChildEndpoints the minChildEndpoints value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withMinChildEndpoints(Long minChildEndpoints) { + this.minChildEndpoints = minChildEndpoints; + return this; + } + + /** + * Get gets or sets the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @return the geoMapping value + */ + public List geoMapping() { + return this.geoMapping; + } + + /** + * Set gets or sets the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @param geoMapping the geoMapping value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoMapping(List geoMapping) { + this.geoMapping = geoMapping; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsImpl.java new file mode 100644 index 000000000000..d7f49ea0dd1b --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoints; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoint; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.DeleteOperationResult; + +class EndpointsImpl extends WrapperImpl implements Endpoints { + private final NetworkManager manager; + + EndpointsImpl(NetworkManager manager) { + super(manager.inner().endpoints()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.updateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public DeleteOperationResult call(DeleteOperationResultInner inner) { + return new DeleteOperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsInner.java new file mode 100644 index 000000000000..6c2b8130180b --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/EndpointsInner.java @@ -0,0 +1,495 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Endpoints. + */ +public class EndpointsInner { + /** The Retrofit service to perform REST calls. */ + private EndpointsService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of EndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EndpointsInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(EndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Endpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface EndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2017_03_01.Endpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @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.trafficmanager.v2017_03_01.Endpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2017_03_01.Endpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner update(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner get(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), 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); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner createOrUpdate(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesImpl.java new file mode 100644 index 000000000000..75bf4fca7443 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.GeographicHierarchies; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.TrafficManagerGeographicHierarchy; + +class GeographicHierarchiesImpl extends WrapperImpl implements GeographicHierarchies { + private final NetworkManager manager; + + GeographicHierarchiesImpl(NetworkManager manager) { + super(manager.inner().geographicHierarchies()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable getDefaultAsync() { + GeographicHierarchiesInner client = this.inner(); + return client.getDefaultAsync() + .map(new Func1() { + @Override + public TrafficManagerGeographicHierarchy call(TrafficManagerGeographicHierarchyInner inner) { + return new TrafficManagerGeographicHierarchyImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesInner.java new file mode 100644 index 000000000000..e4dd57e125b1 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/GeographicHierarchiesInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 GeographicHierarchies. + */ +public class GeographicHierarchiesInner { + /** The Retrofit service to perform REST calls. */ + private GeographicHierarchiesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of GeographicHierarchiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GeographicHierarchiesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(GeographicHierarchiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for GeographicHierarchies to be + * 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.v2017_03_01.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); + + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerGeographicHierarchyInner object if successful. + */ + public TrafficManagerGeographicHierarchyInner getDefault() { + return getDefaultWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable getDefaultAsync() { + return getDefaultWithServiceResponseAsync().map(new Func1, TrafficManagerGeographicHierarchyInner>() { + @Override + public TrafficManagerGeographicHierarchyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable> getDefaultWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDefault(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultDelegate(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/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/IdParsingUtils.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..60e4c4d6f81a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/NetworkManager.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/NetworkManager.java new file mode 100644 index 000000000000..84a7801b76a6 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/NetworkManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoints; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.GeographicHierarchies; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private Endpoints endpoints; + private Profiles profiles; + private GeographicHierarchies geographicHierarchies; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(this); + } + return this.endpoints; + } + + /** + * @return Entry point to manage Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(this); + } + return this.profiles; + } + + /** + * @return Entry point to manage GeographicHierarchies. + */ + public GeographicHierarchies geographicHierarchies() { + if (this.geographicHierarchies == null) { + this.geographicHierarchies = new GeographicHierarchiesImpl(this); + } + return this.geographicHierarchies; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new TrafficManagerManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/PageImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/PageImpl.java new file mode 100644 index 000000000000..e25c9978d704 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileImpl.java new file mode 100644 index 000000000000..40c4a58b5c8a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Profile; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.MonitorConfig; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Endpoint; + +class ProfileImpl extends GroupableResourceCoreImpl implements Profile, Profile.Definition, Profile.Update { + ProfileImpl(String name, ProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DnsConfig dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public List endpoints() { + List lst = new ArrayList(); + if (this.inner().endpoints() != null) { + for (EndpointInner inner : this.inner().endpoints()) { + lst.add( new EndpointImpl(inner, manager())); + } + } + return lst; + } + + @Override + public MonitorConfig monitorConfig() { + return this.inner().monitorConfig(); + } + + @Override + public String profileStatus() { + return this.inner().profileStatus(); + } + + @Override + public String trafficRoutingMethod() { + return this.inner().trafficRoutingMethod(); + } + + @Override + public ProfileImpl withDnsConfig(DnsConfig dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ProfileImpl withEndpoints(List endpoints) { + this.inner().withEndpoints(endpoints); + return this; + } + + @Override + public ProfileImpl withMonitorConfig(MonitorConfig monitorConfig) { + this.inner().withMonitorConfig(monitorConfig); + return this; + } + + @Override + public ProfileImpl withProfileStatus(String profileStatus) { + this.inner().withProfileStatus(profileStatus); + return this; + } + + @Override + public ProfileImpl withTrafficRoutingMethod(String trafficRoutingMethod) { + this.inner().withTrafficRoutingMethod(trafficRoutingMethod); + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileInner.java new file mode 100644 index 000000000000..7fc2b8a4316a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfileInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.MonitorConfig; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Class representing a Traffic Manager profile. + */ +@JsonFlatten +@SkipParentValidation +public class ProfileInner extends Resource { + /** + * Gets or sets the status of the Traffic Manager profile. Possible values + * are 'Enabled' and 'Disabled'. + */ + @JsonProperty(value = "properties.profileStatus") + private String profileStatus; + + /** + * Gets or sets the traffic routing method of the Traffic Manager profile. + * Possible values are 'Performance', 'Weighted', 'Priority' or + * 'Geographic'. + */ + @JsonProperty(value = "properties.trafficRoutingMethod") + private String trafficRoutingMethod; + + /** + * Gets or sets the DNS settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfig dnsConfig; + + /** + * Gets or sets the endpoint monitoring settings of the Traffic Manager + * profile. + */ + @JsonProperty(value = "properties.monitorConfig") + private MonitorConfig monitorConfig; + + /** + * Gets or sets the list of endpoints in the Traffic Manager profile. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /** + * Get gets or sets the status of the Traffic Manager profile. Possible values are 'Enabled' and 'Disabled'. + * + * @return the profileStatus value + */ + public String profileStatus() { + return this.profileStatus; + } + + /** + * Set gets or sets the status of the Traffic Manager profile. Possible values are 'Enabled' and 'Disabled'. + * + * @param profileStatus the profileStatus value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withProfileStatus(String profileStatus) { + this.profileStatus = profileStatus; + return this; + } + + /** + * Get gets or sets the traffic routing method of the Traffic Manager profile. Possible values are 'Performance', 'Weighted', 'Priority' or 'Geographic'. + * + * @return the trafficRoutingMethod value + */ + public String trafficRoutingMethod() { + return this.trafficRoutingMethod; + } + + /** + * Set gets or sets the traffic routing method of the Traffic Manager profile. Possible values are 'Performance', 'Weighted', 'Priority' or 'Geographic'. + * + * @param trafficRoutingMethod the trafficRoutingMethod value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withTrafficRoutingMethod(String trafficRoutingMethod) { + this.trafficRoutingMethod = trafficRoutingMethod; + return this; + } + + /** + * Get gets or sets the DNS settings of the Traffic Manager profile. + * + * @return the dnsConfig value + */ + public DnsConfig dnsConfig() { + return this.dnsConfig; + } + + /** + * Set gets or sets the DNS settings of the Traffic Manager profile. + * + * @param dnsConfig the dnsConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withDnsConfig(DnsConfig dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get gets or sets the endpoint monitoring settings of the Traffic Manager profile. + * + * @return the monitorConfig value + */ + public MonitorConfig monitorConfig() { + return this.monitorConfig; + } + + /** + * Set gets or sets the endpoint monitoring settings of the Traffic Manager profile. + * + * @param monitorConfig the monitorConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withMonitorConfig(MonitorConfig monitorConfig) { + this.monitorConfig = monitorConfig; + return this; + } + + /** + * Get gets or sets the list of endpoints in the Traffic Manager profile. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set gets or sets the list of endpoints in the Traffic Manager profile. + * + * @param endpoints the endpoints value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesImpl.java new file mode 100644 index 000000000000..6c862148e1ce --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Profile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.TrafficManagerNameAvailability; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.CheckTrafficManagerRelativeDnsNameAvailabilityParameters; + +class ProfilesImpl extends GroupableResourcesCoreImpl implements Profiles { + protected ProfilesImpl(NetworkManager manager) { + super(manager.inner().profiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ProfilesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + ProfilesInner client = this.inner(); + return client.checkTrafficManagerRelativeDnsNameAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public TrafficManagerNameAvailability call(TrafficManagerNameAvailabilityInner inner) { + return new TrafficManagerNameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + protected ProfileImpl wrapModel(ProfileInner inner) { + return new ProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected ProfileImpl wrapModel(String name) { + return new ProfileImpl(name, new ProfileInner(), this.manager()); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesInner.java new file mode 100644 index 000000000000..42a22597a876 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/ProfilesInner.java @@ -0,0 +1,705 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.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; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Profiles. + */ +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ProfilesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of ProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProfilesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(ProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Profiles to be + * used by Retrofit to perform actually REST calls. + */ + interface ProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_03_01.Profiles checkTrafficManagerRelativeDnsNameAvailability" }) + @POST("providers/Microsoft.Network/checkTrafficManagerNameAvailability") + 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.v2017_03_01.Profiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_03_01.Profiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_03_01.Profiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2017_03_01.Profiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner 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.v2017_03_01.Profiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2017_03_01.Profiles update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerNameAvailabilityInner object if successful. + */ + public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, TrafficManagerNameAvailabilityInner>() { + @Override + public TrafficManagerNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkTrafficManagerRelativeDnsNameAvailability(parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkTrafficManagerRelativeDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkTrafficManagerRelativeDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the observable to the List<ProfileInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 ProfileInner object if successful. + */ + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 getByResourceGroupAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner createOrUpdate(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java new file mode 100644 index 000000000000..4e2616fe5b16 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.TrafficManagerGeographicHierarchy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Region; +import java.util.Map; + +class TrafficManagerGeographicHierarchyImpl extends WrapperImpl implements TrafficManagerGeographicHierarchy { + private final NetworkManager manager; + TrafficManagerGeographicHierarchyImpl(TrafficManagerGeographicHierarchyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Region geographicHierarchy() { + return this.inner().geographicHierarchy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyInner.java new file mode 100644 index 000000000000..13e0a260e39f --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerGeographicHierarchyInner.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.Region; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Class representing the Geographic hierarchy used with the Geographic traffic + * routing method. + */ +@JsonFlatten +@SkipParentValidation +public class TrafficManagerGeographicHierarchyInner extends Resource { + /** + * The region at the root of the hierarchy from all the regions in the + * hierarchy can be retrieved. + */ + @JsonProperty(value = "properties.geographicHierarchy") + private Region geographicHierarchy; + + /** + * Get the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @return the geographicHierarchy value + */ + public Region geographicHierarchy() { + return this.geographicHierarchy; + } + + /** + * Set the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @param geographicHierarchy the geographicHierarchy value to set + * @return the TrafficManagerGeographicHierarchyInner object itself. + */ + public TrafficManagerGeographicHierarchyInner withGeographicHierarchy(Region geographicHierarchy) { + this.geographicHierarchy = geographicHierarchy; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerManagementClientImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerManagementClientImpl.java new file mode 100644 index 000000000000..2bf0e71bf27c --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the TrafficManagerManagementClientImpl class. + */ +public class TrafficManagerManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The EndpointsInner object to access its operations. + */ + private EndpointsInner endpoints; + + /** + * Gets the EndpointsInner object to access its operations. + * @return the EndpointsInner object. + */ + public EndpointsInner endpoints() { + return this.endpoints; + } + + /** + * The ProfilesInner object to access its operations. + */ + private ProfilesInner profiles; + + /** + * Gets the ProfilesInner object to access its operations. + * @return the ProfilesInner object. + */ + public ProfilesInner profiles() { + return this.profiles; + } + + /** + * The GeographicHierarchiesInner object to access its operations. + */ + private GeographicHierarchiesInner geographicHierarchies; + + /** + * Gets the GeographicHierarchiesInner object to access its operations. + * @return the GeographicHierarchiesInner object. + */ + public GeographicHierarchiesInner geographicHierarchies() { + return this.geographicHierarchies; + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public TrafficManagerManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-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.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2017-03-01"); + } +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityImpl.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityImpl.java new file mode 100644 index 000000000000..cc86bd28b3b2 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_03_01.TrafficManagerNameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TrafficManagerNameAvailabilityImpl extends WrapperImpl implements TrafficManagerNameAvailability { + private final NetworkManager manager; + TrafficManagerNameAvailabilityImpl(TrafficManagerNameAvailabilityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityInner.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityInner.java new file mode 100644 index 000000000000..26841498a27f --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/TrafficManagerNameAvailabilityInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager Name Availability response. + */ +public class TrafficManagerNameAvailabilityInner { + /** + * The relative name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Traffic Manager profile resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Describes whether the relative name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, when applicable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Descriptive message that explains why the name is not available, when + * applicable. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the relative name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the relative name. + * + * @param name the name value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get traffic Manager profile resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set traffic Manager profile resource type. + * + * @param type the type value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get describes whether the relative name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set describes whether the relative name is available or not. + * + * @param nameAvailable the nameAvailable value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, when applicable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, when applicable. + * + * @param reason the reason value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get descriptive message that explains why the name is not available, when applicable. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set descriptive message that explains why the name is not available, when applicable. + * + * @param message the message value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/package-info.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/package-info.java new file mode 100644 index 000000000000..32102ec7debb --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2017_03_01.implementation; diff --git a/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/package-info.java b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/package-info.java new file mode 100644 index 000000000000..d54503068ca6 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_03_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2017_03_01; diff --git a/trafficmanager/resource-manager/v2017_05_01/pom.xml b/trafficmanager/resource-manager/v2017_05_01/pom.xml new file mode 100644 index 000000000000..faf9b7af8f24 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.trafficmanager.v2017_05_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java new file mode 100644 index 000000000000..b5c1d5cc512e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/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.v2017_05_01; + +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 of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. + * + * @param name the name value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the resource. + * + * @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/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DeleteOperationResult.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DeleteOperationResult.java new file mode 100644 index 000000000000..aea45d5a4e2f --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DeleteOperationResult.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.DeleteOperationResultInner; + +/** + * Type representing DeleteOperationResult. + */ +public interface DeleteOperationResult extends HasInner, HasManager { + /** + * @return the operationResult value. + */ + Boolean operationResult(); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DnsConfig.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DnsConfig.java new file mode 100644 index 000000000000..58f43c1b360a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/DnsConfig.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing DNS settings in a Traffic Manager profile. + */ +public class DnsConfig { + /** + * The relative DNS name provided by this Traffic Manager profile. This + * value is combined with the DNS domain name used by Azure Traffic Manager + * to form the fully-qualified domain name (FQDN) of the profile. + */ + @JsonProperty(value = "relativeName") + private String relativeName; + + /** + * The fully-qualified domain name (FQDN) of the Traffic Manager profile. + * This is formed from the concatenation of the RelativeName with the DNS + * domain used by Azure Traffic Manager. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * The DNS Time-To-Live (TTL), in seconds. This informs the local DNS + * resolvers and DNS clients how long to cache DNS responses provided by + * this Traffic Manager profile. + */ + @JsonProperty(value = "ttl") + private Long ttl; + + /** + * Get the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @return the relativeName value + */ + public String relativeName() { + return this.relativeName; + } + + /** + * Set the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @param relativeName the relativeName value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withRelativeName(String relativeName) { + this.relativeName = relativeName; + return this; + } + + /** + * Get the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @return the ttl value + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set the DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @param ttl the ttl value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoint.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoint.java new file mode 100644 index 000000000000..6c93cf13b98d --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoint.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.EndpointInner; +import java.util.List; + +/** + * Type representing Endpoint. + */ +public interface Endpoint extends HasInner, HasManager { + /** + * @return the endpointLocation value. + */ + String endpointLocation(); + + /** + * @return the endpointMonitorStatus value. + */ + EndpointMonitorStatus endpointMonitorStatus(); + + /** + * @return the endpointStatus value. + */ + EndpointStatus endpointStatus(); + + /** + * @return the geoMapping value. + */ + List geoMapping(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minChildEndpoints value. + */ + Long minChildEndpoints(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Long priority(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the weight value. + */ + Long weight(); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointMonitorStatus.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointMonitorStatus.java new file mode 100644 index 000000000000..5ff4c9eb8a1e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointMonitorStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointMonitorStatus. + */ +public final class EndpointMonitorStatus extends ExpandableStringEnum { + /** Static value CheckingEndpoint for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus CHECKING_ENDPOINT = fromString("CheckingEndpoint"); + + /** Static value Online for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus ONLINE = fromString("Online"); + + /** Static value Degraded for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus DEGRADED = fromString("Degraded"); + + /** Static value Disabled for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus DISABLED = fromString("Disabled"); + + /** Static value Inactive for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus INACTIVE = fromString("Inactive"); + + /** Static value Stopped for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus STOPPED = fromString("Stopped"); + + /** + * Creates or finds a EndpointMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointMonitorStatus + */ + @JsonCreator + public static EndpointMonitorStatus fromString(String name) { + return fromString(name, EndpointMonitorStatus.class); + } + + /** + * @return known EndpointMonitorStatus values + */ + public static Collection values() { + return values(EndpointMonitorStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointStatus.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointStatus.java new file mode 100644 index 000000000000..e66681c8f3fe --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/EndpointStatus.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.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointStatus. + */ +public final class EndpointStatus extends ExpandableStringEnum { + /** Static value Enabled for EndpointStatus. */ + public static final EndpointStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for EndpointStatus. */ + public static final EndpointStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EndpointStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointStatus + */ + @JsonCreator + public static EndpointStatus fromString(String name) { + return fromString(name, EndpointStatus.class); + } + + /** + * @return known EndpointStatus values + */ + public static Collection values() { + return values(EndpointStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoints.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoints.java new file mode 100644 index 000000000000..2cbb0798bed4 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Endpoints.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.EndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Endpoints. + */ +public interface Endpoints extends HasInner { + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/GeographicHierarchies.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/GeographicHierarchies.java new file mode 100644 index 000000000000..3753e914756a --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/GeographicHierarchies.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.GeographicHierarchiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GeographicHierarchies. + */ +public interface GeographicHierarchies extends HasInner { + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultAsync(); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorConfig.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorConfig.java new file mode 100644 index 000000000000..ded59656130f --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorConfig.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing endpoint monitoring settings in a Traffic Manager profile. + */ +public class MonitorConfig { + /** + * The profile-level monitoring status of the Traffic Manager profile. + * Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', + * 'Disabled', 'Inactive'. + */ + @JsonProperty(value = "profileMonitorStatus") + private ProfileMonitorStatus profileMonitorStatus; + + /** + * The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. + * Possible values include: 'HTTP', 'HTTPS', 'TCP'. + */ + @JsonProperty(value = "protocol") + private MonitorProtocol protocol; + + /** + * The TCP port used to probe for endpoint health. + */ + @JsonProperty(value = "port") + private Long port; + + /** + * The path relative to the endpoint domain name used to probe for endpoint + * health. + */ + @JsonProperty(value = "path") + private String path; + + /** + * The monitor interval for endpoints in this profile. This is the interval + * at which Traffic Manager will check the health of each endpoint in this + * profile. + */ + @JsonProperty(value = "intervalInSeconds") + private Long intervalInSeconds; + + /** + * The monitor timeout for endpoints in this profile. This is the time that + * Traffic Manager allows endpoints in this profile to response to the + * health check. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /** + * The number of consecutive failed health check that Traffic Manager + * tolerates before declaring an endpoint in this profile Degraded after + * the next failed health check. + */ + @JsonProperty(value = "toleratedNumberOfFailures") + private Long toleratedNumberOfFailures; + + /** + * Get the profile-level monitoring status of the Traffic Manager profile. Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'. + * + * @return the profileMonitorStatus value + */ + public ProfileMonitorStatus profileMonitorStatus() { + return this.profileMonitorStatus; + } + + /** + * Set the profile-level monitoring status of the Traffic Manager profile. Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'. + * + * @param profileMonitorStatus the profileMonitorStatus value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProfileMonitorStatus(ProfileMonitorStatus profileMonitorStatus) { + this.profileMonitorStatus = profileMonitorStatus; + return this; + } + + /** + * Get the protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'. + * + * @return the protocol value + */ + public MonitorProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'. + * + * @param protocol the protocol value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProtocol(MonitorProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the TCP port used to probe for endpoint health. + * + * @return the port value + */ + public Long port() { + return this.port; + } + + /** + * Set the TCP port used to probe for endpoint health. + * + * @param port the port value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPort(Long port) { + this.port = port; + return this; + } + + /** + * Get the path relative to the endpoint domain name used to probe for endpoint health. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path relative to the endpoint domain name used to probe for endpoint health. + * + * @param path the path value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile. + * + * @return the intervalInSeconds value + */ + public Long intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withIntervalInSeconds(Long intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check. + * + * @return the timeoutInSeconds value + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check. + * + * @param timeoutInSeconds the timeoutInSeconds value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check. + * + * @return the toleratedNumberOfFailures value + */ + public Long toleratedNumberOfFailures() { + return this.toleratedNumberOfFailures; + } + + /** + * Set the number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check. + * + * @param toleratedNumberOfFailures the toleratedNumberOfFailures value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withToleratedNumberOfFailures(Long toleratedNumberOfFailures) { + this.toleratedNumberOfFailures = toleratedNumberOfFailures; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorProtocol.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorProtocol.java new file mode 100644 index 000000000000..5c06ae30b0cd --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/MonitorProtocol.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.trafficmanager.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MonitorProtocol. + */ +public final class MonitorProtocol extends ExpandableStringEnum { + /** Static value HTTP for MonitorProtocol. */ + public static final MonitorProtocol HTTP = fromString("HTTP"); + + /** Static value HTTPS for MonitorProtocol. */ + public static final MonitorProtocol HTTPS = fromString("HTTPS"); + + /** Static value TCP for MonitorProtocol. */ + public static final MonitorProtocol TCP = fromString("TCP"); + + /** + * Creates or finds a MonitorProtocol from its string representation. + * @param name a name to look for + * @return the corresponding MonitorProtocol + */ + @JsonCreator + public static MonitorProtocol fromString(String name) { + return fromString(name, MonitorProtocol.class); + } + + /** + * @return known MonitorProtocol values + */ + public static Collection values() { + return values(MonitorProtocol.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profile.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profile.java new file mode 100644 index 000000000000..a7fe66b49213 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profile.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.ProfileInner; + +/** + * Type representing Profile. + */ +public interface Profile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsConfig value. + */ + DnsConfig dnsConfig(); + + /** + * @return the endpoints value. + */ + List endpoints(); + + /** + * @return the monitorConfig value. + */ + MonitorConfig monitorConfig(); + + /** + * @return the profileStatus value. + */ + ProfileStatus profileStatus(); + + /** + * @return the trafficRoutingMethod value. + */ + TrafficRoutingMethod trafficRoutingMethod(); + + /** + * The entirety of the Profile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Profile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Profile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Profile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the profile update allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + WithCreate withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile update allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + WithCreate withEndpoints(List endpoints); + } + + /** + * The stage of the profile update allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + WithCreate withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile update allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + WithCreate withProfileStatus(ProfileStatus profileStatus); + } + + /** + * The stage of the profile update allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + WithCreate withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsConfig, DefinitionStages.WithEndpoints, DefinitionStages.WithMonitorConfig, DefinitionStages.WithProfileStatus, DefinitionStages.WithTrafficRoutingMethod { + } + } + /** + * The template for a Profile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsConfig, UpdateStages.WithEndpoints, UpdateStages.WithMonitorConfig, UpdateStages.WithProfileStatus, UpdateStages.WithTrafficRoutingMethod { + } + + /** + * Grouping of Profile update stages. + */ + interface UpdateStages { + /** + * The stage of the profile {0} allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + Update withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile {0} allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + Update withEndpoints(List endpoints); + } + + /** + * The stage of the profile {0} allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + Update withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile {0} allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + Update withProfileStatus(ProfileStatus profileStatus); + } + + /** + * The stage of the profile {0} allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + Update withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod); + } + + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileMonitorStatus.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileMonitorStatus.java new file mode 100644 index 000000000000..61b3462b4d8e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileMonitorStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProfileMonitorStatus. + */ +public final class ProfileMonitorStatus extends ExpandableStringEnum { + /** Static value CheckingEndpoints for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus CHECKING_ENDPOINTS = fromString("CheckingEndpoints"); + + /** Static value Online for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus ONLINE = fromString("Online"); + + /** Static value Degraded for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus DEGRADED = fromString("Degraded"); + + /** Static value Disabled for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus DISABLED = fromString("Disabled"); + + /** Static value Inactive for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ProfileMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileMonitorStatus + */ + @JsonCreator + public static ProfileMonitorStatus fromString(String name) { + return fromString(name, ProfileMonitorStatus.class); + } + + /** + * @return known ProfileMonitorStatus values + */ + public static Collection values() { + return values(ProfileMonitorStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileStatus.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileStatus.java new file mode 100644 index 000000000000..7e1965c2ed4e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/ProfileStatus.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.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProfileStatus. + */ +public final class ProfileStatus extends ExpandableStringEnum { + /** Static value Enabled for ProfileStatus. */ + public static final ProfileStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for ProfileStatus. */ + public static final ProfileStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ProfileStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileStatus + */ + @JsonCreator + public static ProfileStatus fromString(String name) { + return fromString(name, ProfileStatus.class); + } + + /** + * @return known ProfileStatus values + */ + public static Collection values() { + return values(ProfileStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profiles.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profiles.java new file mode 100644 index 000000000000..fe195ea882a8 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Profiles.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.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.ProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Profiles. + */ +public interface Profiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Region.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Region.java new file mode 100644 index 000000000000..230791832081 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/Region.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a region in the Geographic hierarchy used with the + * Geographic traffic routing method. + */ +public class Region { + /** + * The code of the region. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The name of the region. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The list of Regions grouped under this Region in the Geographic + * Hierarchy. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the code of the region. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code of the region. + * + * @param code the code value to set + * @return the Region object itself. + */ + public Region withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the name of the region. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the region. + * + * @param name the name value to set + * @return the Region object itself. + */ + public Region withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @param regions the regions value to set + * @return the Region object itself. + */ + public Region withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerGeographicHierarchy.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerGeographicHierarchy.java new file mode 100644 index 000000000000..e39b48b2ed8b --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerGeographicHierarchy.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.TrafficManagerGeographicHierarchyInner; + +/** + * Type representing TrafficManagerGeographicHierarchy. + */ +public interface TrafficManagerGeographicHierarchy extends HasInner, HasManager { + /** + * @return the geographicHierarchy value. + */ + Region geographicHierarchy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerNameAvailability.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerNameAvailability.java new file mode 100644 index 000000000000..f059d3c126a8 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficManagerNameAvailability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation.TrafficManagerNameAvailabilityInner; + +/** + * Type representing TrafficManagerNameAvailability. + */ +public interface TrafficManagerNameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficRoutingMethod.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficRoutingMethod.java new file mode 100644 index 000000000000..7380ea82792e --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/TrafficRoutingMethod.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrafficRoutingMethod. + */ +public final class TrafficRoutingMethod extends ExpandableStringEnum { + /** Static value Performance for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod PERFORMANCE = fromString("Performance"); + + /** Static value Priority for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod PRIORITY = fromString("Priority"); + + /** Static value Weighted for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod WEIGHTED = fromString("Weighted"); + + /** Static value Geographic for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod GEOGRAPHIC = fromString("Geographic"); + + /** + * Creates or finds a TrafficRoutingMethod from its string representation. + * @param name a name to look for + * @return the corresponding TrafficRoutingMethod + */ + @JsonCreator + public static TrafficRoutingMethod fromString(String name) { + return fromString(name, TrafficRoutingMethod.class); + } + + /** + * @return known TrafficRoutingMethod values + */ + public static Collection values() { + return values(TrafficRoutingMethod.class); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultImpl.java new file mode 100644 index 000000000000..08b98d17578c --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.DeleteOperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DeleteOperationResultImpl extends WrapperImpl implements DeleteOperationResult { + private final NetworkManager manager; + DeleteOperationResultImpl(DeleteOperationResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean operationResult() { + return this.inner().operationResult(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultInner.java new file mode 100644 index 000000000000..d0012fce70a9 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/DeleteOperationResultInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of the request or operation. + */ +public class DeleteOperationResultInner { + /** + * The result of the operation or request. + */ + @JsonProperty(value = "boolean", access = JsonProperty.Access.WRITE_ONLY) + private Boolean operationResult; + + /** + * Get the result of the operation or request. + * + * @return the operationResult value + */ + public Boolean operationResult() { + return this.operationResult; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointImpl.java new file mode 100644 index 000000000000..cd119c30e6d6 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoint; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.EndpointMonitorStatus; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.EndpointStatus; +import java.util.List; + +class EndpointImpl extends WrapperImpl implements Endpoint { + private final NetworkManager manager; + EndpointImpl(EndpointInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String endpointLocation() { + return this.inner().endpointLocation(); + } + + @Override + public EndpointMonitorStatus endpointMonitorStatus() { + return this.inner().endpointMonitorStatus(); + } + + @Override + public EndpointStatus endpointStatus() { + return this.inner().endpointStatus(); + } + + @Override + public List geoMapping() { + return this.inner().geoMapping(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long minChildEndpoints() { + return this.inner().minChildEndpoints(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long priority() { + return this.inner().priority(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long weight() { + return this.inner().weight(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointInner.java new file mode 100644 index 000000000000..a62c102607cb --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointInner.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.EndpointStatus; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.EndpointMonitorStatus; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a Traffic Manager endpoint. + */ +@JsonFlatten +public class EndpointInner extends ProxyResource { + /** + * The Azure Resource URI of the of the endpoint. Not applicable to + * endpoints of type 'ExternalEndpoints'. + */ + @JsonProperty(value = "properties.targetResourceId") + 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. + */ + @JsonProperty(value = "properties.target") + private String target; + + /** + * The status of the endpoint. If the endpoint is Enabled, it is probed for + * endpoint health and is included in the traffic routing method. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.endpointStatus") + private EndpointStatus endpointStatus; + + /** + * The weight of this endpoint when using the 'Weighted' traffic routing + * method. Possible values are from 1 to 1000. + */ + @JsonProperty(value = "properties.weight") + private Long weight; + + /** + * The priority of this endpoint when using the ‘Priority’ traffic routing + * method. Possible values are from 1 to 1000, lower values represent + * higher priority. This is an optional parameter. If specified, it must + * be specified on all endpoints, and no two endpoints can share the same + * priority value. + */ + @JsonProperty(value = "properties.priority") + private Long priority; + + /** + * Specifies the location of the external or nested endpoints when using + * the ‘Performance’ traffic routing method. + */ + @JsonProperty(value = "properties.endpointLocation") + private String endpointLocation; + + /** + * The monitoring status of the endpoint. Possible values include: + * 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', + * 'Stopped'. + */ + @JsonProperty(value = "properties.endpointMonitorStatus") + private EndpointMonitorStatus endpointMonitorStatus; + + /** + * The minimum number of endpoints that must be available in the child + * profile in order for the parent profile to be considered available. Only + * applicable to endpoint of type 'NestedEndpoints'. + */ + @JsonProperty(value = "properties.minChildEndpoints") + private Long minChildEndpoints; + + /** + * The list of countries/regions mapped to this endpoint when using the + * ‘Geographic’ traffic routing method. Please consult Traffic Manager + * Geographic documentation for a full list of accepted values. + */ + @JsonProperty(value = "properties.geoMapping") + private List geoMapping; + + /** + * Get the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @param targetResourceId the targetResourceId value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the fully-qualified DNS name of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint. + * + * @param target the target value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values include: 'Enabled', 'Disabled'. + * + * @return the endpointStatus value + */ + public EndpointStatus endpointStatus() { + return this.endpointStatus; + } + + /** + * Set the status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values include: 'Enabled', 'Disabled'. + * + * @param endpointStatus the endpointStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointStatus(EndpointStatus endpointStatus) { + this.endpointStatus = endpointStatus; + return this; + } + + /** + * Get the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @return the weight value + */ + public Long weight() { + return this.weight; + } + + /** + * Set the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @param weight the weight value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withWeight(Long weight) { + this.weight = weight; + return this; + } + + /** + * Get the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @return the priority value + */ + public Long priority() { + return this.priority; + } + + /** + * Set the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @param priority the priority value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withPriority(Long priority) { + this.priority = priority; + return this; + } + + /** + * Get specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @return the endpointLocation value + */ + public String endpointLocation() { + return this.endpointLocation; + } + + /** + * Set specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @param endpointLocation the endpointLocation value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointLocation(String endpointLocation) { + this.endpointLocation = endpointLocation; + return this; + } + + /** + * Get the monitoring status of the endpoint. Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', 'Stopped'. + * + * @return the endpointMonitorStatus value + */ + public EndpointMonitorStatus endpointMonitorStatus() { + return this.endpointMonitorStatus; + } + + /** + * Set the monitoring status of the endpoint. Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', 'Stopped'. + * + * @param endpointMonitorStatus the endpointMonitorStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointMonitorStatus(EndpointMonitorStatus endpointMonitorStatus) { + this.endpointMonitorStatus = endpointMonitorStatus; + return this; + } + + /** + * Get the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @return the minChildEndpoints value + */ + public Long minChildEndpoints() { + return this.minChildEndpoints; + } + + /** + * Set the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @param minChildEndpoints the minChildEndpoints value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withMinChildEndpoints(Long minChildEndpoints) { + this.minChildEndpoints = minChildEndpoints; + return this; + } + + /** + * Get the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @return the geoMapping value + */ + public List geoMapping() { + return this.geoMapping; + } + + /** + * Set the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @param geoMapping the geoMapping value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoMapping(List geoMapping) { + this.geoMapping = geoMapping; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsImpl.java new file mode 100644 index 000000000000..8868cb45df87 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoints; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoint; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.DeleteOperationResult; + +class EndpointsImpl extends WrapperImpl implements Endpoints { + private final NetworkManager manager; + + EndpointsImpl(NetworkManager manager) { + super(manager.inner().endpoints()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.updateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public DeleteOperationResult call(DeleteOperationResultInner inner) { + return new DeleteOperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsInner.java new file mode 100644 index 000000000000..5ea898647cf0 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/EndpointsInner.java @@ -0,0 +1,495 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Endpoints. + */ +public class EndpointsInner { + /** The Retrofit service to perform REST calls. */ + private EndpointsService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of EndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EndpointsInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(EndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Endpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface EndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2017_05_01.Endpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @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.trafficmanager.v2017_05_01.Endpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2017_05_01.Endpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner update(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner get(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), 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); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner createOrUpdate(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesImpl.java new file mode 100644 index 000000000000..f360d5c93038 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.GeographicHierarchies; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficManagerGeographicHierarchy; + +class GeographicHierarchiesImpl extends WrapperImpl implements GeographicHierarchies { + private final NetworkManager manager; + + GeographicHierarchiesImpl(NetworkManager manager) { + super(manager.inner().geographicHierarchies()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable getDefaultAsync() { + GeographicHierarchiesInner client = this.inner(); + return client.getDefaultAsync() + .map(new Func1() { + @Override + public TrafficManagerGeographicHierarchy call(TrafficManagerGeographicHierarchyInner inner) { + return new TrafficManagerGeographicHierarchyImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesInner.java new file mode 100644 index 000000000000..c41c8eb67fb6 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/GeographicHierarchiesInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 GeographicHierarchies. + */ +public class GeographicHierarchiesInner { + /** The Retrofit service to perform REST calls. */ + private GeographicHierarchiesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of GeographicHierarchiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GeographicHierarchiesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(GeographicHierarchiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for GeographicHierarchies to be + * 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.v2017_05_01.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); + + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerGeographicHierarchyInner object if successful. + */ + public TrafficManagerGeographicHierarchyInner getDefault() { + return getDefaultWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable getDefaultAsync() { + return getDefaultWithServiceResponseAsync().map(new Func1, TrafficManagerGeographicHierarchyInner>() { + @Override + public TrafficManagerGeographicHierarchyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable> getDefaultWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDefault(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultDelegate(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/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/IdParsingUtils.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..8ac24ea8b343 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/NetworkManager.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/NetworkManager.java new file mode 100644 index 000000000000..4fa6afc2140b --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/NetworkManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoints; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.GeographicHierarchies; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private Endpoints endpoints; + private Profiles profiles; + private GeographicHierarchies geographicHierarchies; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(this); + } + return this.endpoints; + } + + /** + * @return Entry point to manage Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(this); + } + return this.profiles; + } + + /** + * @return Entry point to manage GeographicHierarchies. + */ + public GeographicHierarchies geographicHierarchies() { + if (this.geographicHierarchies == null) { + this.geographicHierarchies = new GeographicHierarchiesImpl(this); + } + return this.geographicHierarchies; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new TrafficManagerManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/PageImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/PageImpl.java new file mode 100644 index 000000000000..3402b7c76843 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileImpl.java new file mode 100644 index 000000000000..4f77e5fc0137 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Profile; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.ProfileStatus; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficRoutingMethod; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.MonitorConfig; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Endpoint; + +class ProfileImpl extends GroupableResourceCoreImpl implements Profile, Profile.Definition, Profile.Update { + ProfileImpl(String name, ProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DnsConfig dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public List endpoints() { + List lst = new ArrayList(); + if (this.inner().endpoints() != null) { + for (EndpointInner inner : this.inner().endpoints()) { + lst.add( new EndpointImpl(inner, manager())); + } + } + return lst; + } + + @Override + public MonitorConfig monitorConfig() { + return this.inner().monitorConfig(); + } + + @Override + public ProfileStatus profileStatus() { + return this.inner().profileStatus(); + } + + @Override + public TrafficRoutingMethod trafficRoutingMethod() { + return this.inner().trafficRoutingMethod(); + } + + @Override + public ProfileImpl withDnsConfig(DnsConfig dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ProfileImpl withEndpoints(List endpoints) { + this.inner().withEndpoints(endpoints); + return this; + } + + @Override + public ProfileImpl withMonitorConfig(MonitorConfig monitorConfig) { + this.inner().withMonitorConfig(monitorConfig); + return this; + } + + @Override + public ProfileImpl withProfileStatus(ProfileStatus profileStatus) { + this.inner().withProfileStatus(profileStatus); + return this; + } + + @Override + public ProfileImpl withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod) { + this.inner().withTrafficRoutingMethod(trafficRoutingMethod); + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileInner.java new file mode 100644 index 000000000000..b2a889183e02 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfileInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.ProfileStatus; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficRoutingMethod; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.MonitorConfig; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Class representing a Traffic Manager profile. + */ +@JsonFlatten +@SkipParentValidation +public class ProfileInner extends Resource { + /** + * The status of the Traffic Manager profile. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.profileStatus") + private ProfileStatus profileStatus; + + /** + * The traffic routing method of the Traffic Manager profile. Possible + * values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + */ + @JsonProperty(value = "properties.trafficRoutingMethod") + private TrafficRoutingMethod trafficRoutingMethod; + + /** + * The DNS settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfig dnsConfig; + + /** + * The endpoint monitoring settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.monitorConfig") + private MonitorConfig monitorConfig; + + /** + * The list of endpoints in the Traffic Manager profile. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /** + * Get the status of the Traffic Manager profile. Possible values include: 'Enabled', 'Disabled'. + * + * @return the profileStatus value + */ + public ProfileStatus profileStatus() { + return this.profileStatus; + } + + /** + * Set the status of the Traffic Manager profile. Possible values include: 'Enabled', 'Disabled'. + * + * @param profileStatus the profileStatus value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withProfileStatus(ProfileStatus profileStatus) { + this.profileStatus = profileStatus; + return this; + } + + /** + * Get the traffic routing method of the Traffic Manager profile. Possible values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + * + * @return the trafficRoutingMethod value + */ + public TrafficRoutingMethod trafficRoutingMethod() { + return this.trafficRoutingMethod; + } + + /** + * Set the traffic routing method of the Traffic Manager profile. Possible values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + * + * @param trafficRoutingMethod the trafficRoutingMethod value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod) { + this.trafficRoutingMethod = trafficRoutingMethod; + return this; + } + + /** + * Get the DNS settings of the Traffic Manager profile. + * + * @return the dnsConfig value + */ + public DnsConfig dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the DNS settings of the Traffic Manager profile. + * + * @param dnsConfig the dnsConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withDnsConfig(DnsConfig dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the endpoint monitoring settings of the Traffic Manager profile. + * + * @return the monitorConfig value + */ + public MonitorConfig monitorConfig() { + return this.monitorConfig; + } + + /** + * Set the endpoint monitoring settings of the Traffic Manager profile. + * + * @param monitorConfig the monitorConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withMonitorConfig(MonitorConfig monitorConfig) { + this.monitorConfig = monitorConfig; + return this; + } + + /** + * Get the list of endpoints in the Traffic Manager profile. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the list of endpoints in the Traffic Manager profile. + * + * @param endpoints the endpoints value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesImpl.java new file mode 100644 index 000000000000..e03013b380a4 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Profile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficManagerNameAvailability; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.CheckTrafficManagerRelativeDnsNameAvailabilityParameters; + +class ProfilesImpl extends GroupableResourcesCoreImpl implements Profiles { + protected ProfilesImpl(NetworkManager manager) { + super(manager.inner().profiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ProfilesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + ProfilesInner client = this.inner(); + return client.checkTrafficManagerRelativeDnsNameAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public TrafficManagerNameAvailability call(TrafficManagerNameAvailabilityInner inner) { + return new TrafficManagerNameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + protected ProfileImpl wrapModel(ProfileInner inner) { + return new ProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected ProfileImpl wrapModel(String name) { + return new ProfileImpl(name, new ProfileInner(), this.manager()); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesInner.java new file mode 100644 index 000000000000..66abf00a4035 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/ProfilesInner.java @@ -0,0 +1,705 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.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; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Profiles. + */ +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ProfilesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of ProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProfilesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(ProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Profiles to be + * used by Retrofit to perform actually REST calls. + */ + interface ProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_05_01.Profiles checkTrafficManagerRelativeDnsNameAvailability" }) + @POST("providers/Microsoft.Network/checkTrafficManagerNameAvailability") + 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.v2017_05_01.Profiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_05_01.Profiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2017_05_01.Profiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2017_05_01.Profiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner 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.v2017_05_01.Profiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2017_05_01.Profiles update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerNameAvailabilityInner object if successful. + */ + public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, TrafficManagerNameAvailabilityInner>() { + @Override + public TrafficManagerNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkTrafficManagerRelativeDnsNameAvailability(parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkTrafficManagerRelativeDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkTrafficManagerRelativeDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the observable to the List<ProfileInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 ProfileInner object if successful. + */ + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 getByResourceGroupAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner createOrUpdate(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyImpl.java new file mode 100644 index 000000000000..4acac2aea865 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficManagerGeographicHierarchy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Region; + +class TrafficManagerGeographicHierarchyImpl extends WrapperImpl implements TrafficManagerGeographicHierarchy { + private final NetworkManager manager; + TrafficManagerGeographicHierarchyImpl(TrafficManagerGeographicHierarchyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Region geographicHierarchy() { + return this.inner().geographicHierarchy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyInner.java new file mode 100644 index 000000000000..30b4ba78d326 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerGeographicHierarchyInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.Region; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing the Geographic hierarchy used with the Geographic traffic + * routing method. + */ +@JsonFlatten +public class TrafficManagerGeographicHierarchyInner extends ProxyResource { + /** + * The region at the root of the hierarchy from all the regions in the + * hierarchy can be retrieved. + */ + @JsonProperty(value = "properties.geographicHierarchy") + private Region geographicHierarchy; + + /** + * Get the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @return the geographicHierarchy value + */ + public Region geographicHierarchy() { + return this.geographicHierarchy; + } + + /** + * Set the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @param geographicHierarchy the geographicHierarchy value to set + * @return the TrafficManagerGeographicHierarchyInner object itself. + */ + public TrafficManagerGeographicHierarchyInner withGeographicHierarchy(Region geographicHierarchy) { + this.geographicHierarchy = geographicHierarchy; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerManagementClientImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerManagementClientImpl.java new file mode 100644 index 000000000000..26912842a480 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the TrafficManagerManagementClientImpl class. + */ +public class TrafficManagerManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The EndpointsInner object to access its operations. + */ + private EndpointsInner endpoints; + + /** + * Gets the EndpointsInner object to access its operations. + * @return the EndpointsInner object. + */ + public EndpointsInner endpoints() { + return this.endpoints; + } + + /** + * The ProfilesInner object to access its operations. + */ + private ProfilesInner profiles; + + /** + * Gets the ProfilesInner object to access its operations. + * @return the ProfilesInner object. + */ + public ProfilesInner profiles() { + return this.profiles; + } + + /** + * The GeographicHierarchiesInner object to access its operations. + */ + private GeographicHierarchiesInner geographicHierarchies; + + /** + * Gets the GeographicHierarchiesInner object to access its operations. + * @return the GeographicHierarchiesInner object. + */ + public GeographicHierarchiesInner geographicHierarchies() { + return this.geographicHierarchies; + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public TrafficManagerManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-05-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.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2017-05-01"); + } +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityImpl.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityImpl.java new file mode 100644 index 000000000000..921f7fa81629 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2017_05_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2017_05_01.TrafficManagerNameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TrafficManagerNameAvailabilityImpl extends WrapperImpl implements TrafficManagerNameAvailability { + private final NetworkManager manager; + TrafficManagerNameAvailabilityImpl(TrafficManagerNameAvailabilityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityInner.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityInner.java new file mode 100644 index 000000000000..fac9233354f4 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/TrafficManagerNameAvailabilityInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager Name Availability response. + */ +public class TrafficManagerNameAvailabilityInner { + /** + * The relative name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Traffic Manager profile resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Describes whether the relative name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, when applicable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Descriptive message that explains why the name is not available, when + * applicable. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the relative name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the relative name. + * + * @param name the name value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get traffic Manager profile resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set traffic Manager profile resource type. + * + * @param type the type value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get describes whether the relative name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set describes whether the relative name is available or not. + * + * @param nameAvailable the nameAvailable value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, when applicable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, when applicable. + * + * @param reason the reason value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get descriptive message that explains why the name is not available, when applicable. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set descriptive message that explains why the name is not available, when applicable. + * + * @param message the message value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/package-info.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/package-info.java new file mode 100644 index 000000000000..f698eff045c1 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2017_05_01.implementation; diff --git a/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/package-info.java b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/package-info.java new file mode 100644 index 000000000000..773b5fe923e1 --- /dev/null +++ b/trafficmanager/resource-manager/v2017_05_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2017_05_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2017_05_01; diff --git a/trafficmanager/resource-manager/v2018_03_01/pom.xml b/trafficmanager/resource-manager/v2018_03_01/pom.xml new file mode 100644 index 000000000000..ed388dd71ee9 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.trafficmanager.v2018_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.java new file mode 100644 index 000000000000..11264a4e5a36 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. + * + * @param name the name value to set + * @return the CheckTrafficManagerRelativeDnsNameAvailabilityParameters object itself. + */ + public CheckTrafficManagerRelativeDnsNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the resource. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DeleteOperationResult.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DeleteOperationResult.java new file mode 100644 index 000000000000..91a3e6e767fb --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DeleteOperationResult.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.DeleteOperationResultInner; + +/** + * Type representing DeleteOperationResult. + */ +public interface DeleteOperationResult extends HasInner, HasManager { + /** + * @return the operationResult value. + */ + Boolean operationResult(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DnsConfig.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DnsConfig.java new file mode 100644 index 000000000000..093ff5ee7a36 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/DnsConfig.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing DNS settings in a Traffic Manager profile. + */ +public class DnsConfig { + /** + * The relative DNS name provided by this Traffic Manager profile. This + * value is combined with the DNS domain name used by Azure Traffic Manager + * to form the fully-qualified domain name (FQDN) of the profile. + */ + @JsonProperty(value = "relativeName") + private String relativeName; + + /** + * The fully-qualified domain name (FQDN) of the Traffic Manager profile. + * This is formed from the concatenation of the RelativeName with the DNS + * domain used by Azure Traffic Manager. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * The DNS Time-To-Live (TTL), in seconds. This informs the local DNS + * resolvers and DNS clients how long to cache DNS responses provided by + * this Traffic Manager profile. + */ + @JsonProperty(value = "ttl") + private Long ttl; + + /** + * Get the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @return the relativeName value + */ + public String relativeName() { + return this.relativeName; + } + + /** + * Set the relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile. + * + * @param relativeName the relativeName value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withRelativeName(String relativeName) { + this.relativeName = relativeName; + return this; + } + + /** + * Get the fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @return the ttl value + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set the DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile. + * + * @param ttl the ttl value to set + * @return the DnsConfig object itself. + */ + public DnsConfig withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoint.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoint.java new file mode 100644 index 000000000000..6d6cc024a1ae --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoint.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.EndpointInner; +import java.util.List; + +/** + * Type representing Endpoint. + */ +public interface Endpoint extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + List customHeaders(); + + /** + * @return the endpointLocation value. + */ + String endpointLocation(); + + /** + * @return the endpointMonitorStatus value. + */ + EndpointMonitorStatus endpointMonitorStatus(); + + /** + * @return the endpointStatus value. + */ + EndpointStatus endpointStatus(); + + /** + * @return the geoMapping value. + */ + List geoMapping(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minChildEndpoints value. + */ + Long minChildEndpoints(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Long priority(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the weight value. + */ + Long weight(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointMonitorStatus.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointMonitorStatus.java new file mode 100644 index 000000000000..c9b22a9906f5 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointMonitorStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointMonitorStatus. + */ +public final class EndpointMonitorStatus extends ExpandableStringEnum { + /** Static value CheckingEndpoint for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus CHECKING_ENDPOINT = fromString("CheckingEndpoint"); + + /** Static value Online for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus ONLINE = fromString("Online"); + + /** Static value Degraded for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus DEGRADED = fromString("Degraded"); + + /** Static value Disabled for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus DISABLED = fromString("Disabled"); + + /** Static value Inactive for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus INACTIVE = fromString("Inactive"); + + /** Static value Stopped for EndpointMonitorStatus. */ + public static final EndpointMonitorStatus STOPPED = fromString("Stopped"); + + /** + * Creates or finds a EndpointMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointMonitorStatus + */ + @JsonCreator + public static EndpointMonitorStatus fromString(String name) { + return fromString(name, EndpointMonitorStatus.class); + } + + /** + * @return known EndpointMonitorStatus values + */ + public static Collection values() { + return values(EndpointMonitorStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointPropertiesCustomHeadersItem.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointPropertiesCustomHeadersItem.java new file mode 100644 index 000000000000..2a328150223d --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 header name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set header name. + * + * @param name the name value to set + * @return the EndpointPropertiesCustomHeadersItem object itself. + */ + public EndpointPropertiesCustomHeadersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get header value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set header 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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointStatus.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointStatus.java new file mode 100644 index 000000000000..6bfd1a169c73 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/EndpointStatus.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.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointStatus. + */ +public final class EndpointStatus extends ExpandableStringEnum { + /** Static value Enabled for EndpointStatus. */ + public static final EndpointStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for EndpointStatus. */ + public static final EndpointStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EndpointStatus from its string representation. + * @param name a name to look for + * @return the corresponding EndpointStatus + */ + @JsonCreator + public static EndpointStatus fromString(String name) { + return fromString(name, EndpointStatus.class); + } + + /** + * @return known EndpointStatus values + */ + public static Collection values() { + return values(EndpointStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoints.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoints.java new file mode 100644 index 000000000000..18b6236070b5 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Endpoints.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.EndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Endpoints. + */ +public interface Endpoints extends HasInner { + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters); + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/GeographicHierarchies.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/GeographicHierarchies.java new file mode 100644 index 000000000000..86842e048cf8 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/GeographicHierarchies.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.GeographicHierarchiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GeographicHierarchies. + */ +public interface GeographicHierarchies extends HasInner { + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultAsync(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMapEndpoint.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMapEndpoint.java new file mode 100644 index 000000000000..df2ad6ac2bd9 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 ARM Resource ID of this Traffic Manager endpoint. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ARM Resource ID of this Traffic Manager endpoint. + * + * @param resourceId the resourceId value to set + * @return the HeatMapEndpoint object itself. + */ + public HeatMapEndpoint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get a number uniquely identifying this endpoint in query experiences. + * + * @return the endpointId value + */ + public Integer endpointId() { + return this.endpointId; + } + + /** + * Set a number uniquely identifying this endpoint in query experiences. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMapModel.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMapModel.java new file mode 100644 index 000000000000..247811e84f2b --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMapModel.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.HeatMapModelInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing HeatMapModel. + */ +public interface HeatMapModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endpoints value. + */ + List endpoints(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the trafficFlows value. + */ + List trafficFlows(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMaps.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMaps.java new file mode 100644 index 000000000000..dd9d0479175b --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/HeatMaps.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.HeatMapsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HeatMaps. + */ +public interface HeatMaps extends HasInner { + /** + * 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 for the request + */ + Observable getAsync(String resourceGroupName, String profileName); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfig.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfig.java new file mode 100644 index 000000000000..35706b409de3 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfig.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class containing endpoint monitoring settings in a Traffic Manager profile. + */ +public class MonitorConfig { + /** + * The profile-level monitoring status of the Traffic Manager profile. + * Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', + * 'Disabled', 'Inactive'. + */ + @JsonProperty(value = "profileMonitorStatus") + private ProfileMonitorStatus profileMonitorStatus; + + /** + * The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. + * Possible values include: 'HTTP', 'HTTPS', 'TCP'. + */ + @JsonProperty(value = "protocol") + private MonitorProtocol protocol; + + /** + * The TCP port used to probe for endpoint health. + */ + @JsonProperty(value = "port") + private Long port; + + /** + * The path relative to the endpoint domain name used to probe for endpoint + * health. + */ + @JsonProperty(value = "path") + private String path; + + /** + * The monitor interval for endpoints in this profile. This is the interval + * at which Traffic Manager will check the health of each endpoint in this + * profile. + */ + @JsonProperty(value = "intervalInSeconds") + private Long intervalInSeconds; + + /** + * The monitor timeout for endpoints in this profile. This is the time that + * Traffic Manager allows endpoints in this profile to response to the + * health check. + */ + @JsonProperty(value = "timeoutInSeconds") + private Long timeoutInSeconds; + + /** + * The number of consecutive failed health check that Traffic Manager + * tolerates before declaring an endpoint in this profile Degraded after + * the next failed health check. + */ + @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 profile-level monitoring status of the Traffic Manager profile. Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'. + * + * @return the profileMonitorStatus value + */ + public ProfileMonitorStatus profileMonitorStatus() { + return this.profileMonitorStatus; + } + + /** + * Set the profile-level monitoring status of the Traffic Manager profile. Possible values include: 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'. + * + * @param profileMonitorStatus the profileMonitorStatus value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProfileMonitorStatus(ProfileMonitorStatus profileMonitorStatus) { + this.profileMonitorStatus = profileMonitorStatus; + return this; + } + + /** + * Get the protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'. + * + * @return the protocol value + */ + public MonitorProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'. + * + * @param protocol the protocol value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withProtocol(MonitorProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the TCP port used to probe for endpoint health. + * + * @return the port value + */ + public Long port() { + return this.port; + } + + /** + * Set the TCP port used to probe for endpoint health. + * + * @param port the port value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPort(Long port) { + this.port = port; + return this; + } + + /** + * Get the path relative to the endpoint domain name used to probe for endpoint health. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path relative to the endpoint domain name used to probe for endpoint health. + * + * @param path the path value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile. + * + * @return the intervalInSeconds value + */ + public Long intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withIntervalInSeconds(Long intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check. + * + * @return the timeoutInSeconds value + */ + public Long timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check. + * + * @param timeoutInSeconds the timeoutInSeconds value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withTimeoutInSeconds(Long timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check. + * + * @return the toleratedNumberOfFailures value + */ + public Long toleratedNumberOfFailures() { + return this.toleratedNumberOfFailures; + } + + /** + * Set the number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check. + * + * @param toleratedNumberOfFailures the toleratedNumberOfFailures value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withToleratedNumberOfFailures(Long toleratedNumberOfFailures) { + this.toleratedNumberOfFailures = toleratedNumberOfFailures; + return this; + } + + /** + * Get list of custom headers. + * + * @return the customHeaders value + */ + public List customHeaders() { + return this.customHeaders; + } + + /** + * Set list of custom headers. + * + * @param customHeaders the customHeaders value to set + * @return the MonitorConfig object itself. + */ + public MonitorConfig withCustomHeaders(List customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get list of expected status code ranges. + * + * @return the expectedStatusCodeRanges value + */ + public List expectedStatusCodeRanges() { + return this.expectedStatusCodeRanges; + } + + /** + * Set list of expected status code ranges. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfigCustomHeadersItem.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfigCustomHeadersItem.java new file mode 100644 index 000000000000..4f5fc882b53f --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 header name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set header name. + * + * @param name the name value to set + * @return the MonitorConfigCustomHeadersItem object itself. + */ + public MonitorConfigCustomHeadersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get header value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set header 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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfigExpectedStatusCodeRangesItem.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorConfigExpectedStatusCodeRangesItem.java new file mode 100644 index 000000000000..5fe9b08173d8 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 min status code. + * + * @return the min value + */ + public Integer min() { + return this.min; + } + + /** + * Set min status code. + * + * @param min the min value to set + * @return the MonitorConfigExpectedStatusCodeRangesItem object itself. + */ + public MonitorConfigExpectedStatusCodeRangesItem withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get max status code. + * + * @return the max value + */ + public Integer max() { + return this.max; + } + + /** + * Set max status code. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorProtocol.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorProtocol.java new file mode 100644 index 000000000000..c4d5a914a715 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/MonitorProtocol.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.trafficmanager.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MonitorProtocol. + */ +public final class MonitorProtocol extends ExpandableStringEnum { + /** Static value HTTP for MonitorProtocol. */ + public static final MonitorProtocol HTTP = fromString("HTTP"); + + /** Static value HTTPS for MonitorProtocol. */ + public static final MonitorProtocol HTTPS = fromString("HTTPS"); + + /** Static value TCP for MonitorProtocol. */ + public static final MonitorProtocol TCP = fromString("TCP"); + + /** + * Creates or finds a MonitorProtocol from its string representation. + * @param name a name to look for + * @return the corresponding MonitorProtocol + */ + @JsonCreator + public static MonitorProtocol fromString(String name) { + return fromString(name, MonitorProtocol.class); + } + + /** + * @return known MonitorProtocol values + */ + public static Collection values() { + return values(MonitorProtocol.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profile.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profile.java new file mode 100644 index 000000000000..9a71e4a69c1d --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profile.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.EndpointInner; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.ProfileInner; + +/** + * Type representing Profile. + */ +public interface Profile extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsConfig value. + */ + DnsConfig dnsConfig(); + + /** + * @return the endpoints value. + */ + List endpoints(); + + /** + * @return the monitorConfig value. + */ + MonitorConfig monitorConfig(); + + /** + * @return the profileStatus value. + */ + ProfileStatus profileStatus(); + + /** + * @return the trafficRoutingMethod value. + */ + TrafficRoutingMethod trafficRoutingMethod(); + + /** + * @return the trafficViewEnrollmentStatus value. + */ + TrafficViewEnrollmentStatus trafficViewEnrollmentStatus(); + + /** + * The entirety of the Profile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Profile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Profile definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Profile definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the profile update allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + WithCreate withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile update allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + WithCreate withEndpoints(List endpoints); + } + + /** + * The stage of the profile update allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + WithCreate withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile update allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + WithCreate withProfileStatus(ProfileStatus profileStatus); + } + + /** + * The stage of the profile update allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + WithCreate withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod); + } + + /** + * The stage of the profile update allowing to specify TrafficViewEnrollmentStatus. + */ + interface WithTrafficViewEnrollmentStatus { + /** + * Specifies trafficViewEnrollmentStatus. + */ + WithCreate withTrafficViewEnrollmentStatus(TrafficViewEnrollmentStatus trafficViewEnrollmentStatus); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsConfig, DefinitionStages.WithEndpoints, DefinitionStages.WithMonitorConfig, DefinitionStages.WithProfileStatus, DefinitionStages.WithTrafficRoutingMethod, DefinitionStages.WithTrafficViewEnrollmentStatus { + } + } + /** + * The template for a Profile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsConfig, UpdateStages.WithEndpoints, UpdateStages.WithMonitorConfig, UpdateStages.WithProfileStatus, UpdateStages.WithTrafficRoutingMethod, UpdateStages.WithTrafficViewEnrollmentStatus { + } + + /** + * Grouping of Profile update stages. + */ + interface UpdateStages { + /** + * The stage of the profile {0} allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + */ + Update withDnsConfig(DnsConfig dnsConfig); + } + + /** + * The stage of the profile {0} allowing to specify Endpoints. + */ + interface WithEndpoints { + /** + * Specifies endpoints. + */ + Update withEndpoints(List endpoints); + } + + /** + * The stage of the profile {0} allowing to specify MonitorConfig. + */ + interface WithMonitorConfig { + /** + * Specifies monitorConfig. + */ + Update withMonitorConfig(MonitorConfig monitorConfig); + } + + /** + * The stage of the profile {0} allowing to specify ProfileStatus. + */ + interface WithProfileStatus { + /** + * Specifies profileStatus. + */ + Update withProfileStatus(ProfileStatus profileStatus); + } + + /** + * The stage of the profile {0} allowing to specify TrafficRoutingMethod. + */ + interface WithTrafficRoutingMethod { + /** + * Specifies trafficRoutingMethod. + */ + Update withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod); + } + + /** + * The stage of the profile {0} allowing to specify TrafficViewEnrollmentStatus. + */ + interface WithTrafficViewEnrollmentStatus { + /** + * Specifies trafficViewEnrollmentStatus. + */ + Update withTrafficViewEnrollmentStatus(TrafficViewEnrollmentStatus trafficViewEnrollmentStatus); + } + + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileMonitorStatus.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileMonitorStatus.java new file mode 100644 index 000000000000..f21f9dbe8a77 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileMonitorStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProfileMonitorStatus. + */ +public final class ProfileMonitorStatus extends ExpandableStringEnum { + /** Static value CheckingEndpoints for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus CHECKING_ENDPOINTS = fromString("CheckingEndpoints"); + + /** Static value Online for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus ONLINE = fromString("Online"); + + /** Static value Degraded for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus DEGRADED = fromString("Degraded"); + + /** Static value Disabled for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus DISABLED = fromString("Disabled"); + + /** Static value Inactive for ProfileMonitorStatus. */ + public static final ProfileMonitorStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ProfileMonitorStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileMonitorStatus + */ + @JsonCreator + public static ProfileMonitorStatus fromString(String name) { + return fromString(name, ProfileMonitorStatus.class); + } + + /** + * @return known ProfileMonitorStatus values + */ + public static Collection values() { + return values(ProfileMonitorStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileStatus.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileStatus.java new file mode 100644 index 000000000000..7a7e27bef304 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/ProfileStatus.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.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProfileStatus. + */ +public final class ProfileStatus extends ExpandableStringEnum { + /** Static value Enabled for ProfileStatus. */ + public static final ProfileStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for ProfileStatus. */ + public static final ProfileStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ProfileStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProfileStatus + */ + @JsonCreator + public static ProfileStatus fromString(String name) { + return fromString(name, ProfileStatus.class); + } + + /** + * @return known ProfileStatus values + */ + public static Collection values() { + return values(ProfileStatus.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profiles.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profiles.java new file mode 100644 index 000000000000..d8fc0ac74a5a --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Profiles.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.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.ProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Profiles. + */ +public interface Profiles extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/QueryExperience.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/QueryExperience.java new file mode 100644 index 000000000000..5c596435bfb6 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 id of the endpoint from the 'endpoints' array which these queries were routed to. + * + * @return the endpointId value + */ + public int endpointId() { + return this.endpointId; + } + + /** + * Set the id of the endpoint from the 'endpoints' array which these queries were routed to. + * + * @param endpointId the endpointId value to set + * @return the QueryExperience object itself. + */ + public QueryExperience withEndpointId(int endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the number of queries originating from this location. + * + * @return the queryCount value + */ + public int queryCount() { + return this.queryCount; + } + + /** + * Set the number of queries originating from this location. + * + * @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 experienced by queries originating from this location. + * + * @return the latency value + */ + public Double latency() { + return this.latency; + } + + /** + * Set the latency experienced by queries originating from this location. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Region.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Region.java new file mode 100644 index 000000000000..f6540c64260f --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/Region.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a region in the Geographic hierarchy used with the + * Geographic traffic routing method. + */ +public class Region { + /** + * The code of the region. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The name of the region. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The list of Regions grouped under this Region in the Geographic + * Hierarchy. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * Get the code of the region. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code of the region. + * + * @param code the code value to set + * @return the Region object itself. + */ + public Region withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the name of the region. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the region. + * + * @param name the name value to set + * @return the Region object itself. + */ + public Region withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of Regions grouped under this Region in the Geographic Hierarchy. + * + * @param regions the regions value to set + * @return the Region object itself. + */ + public Region withRegions(List regions) { + this.regions = regions; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficFlow.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficFlow.java new file mode 100644 index 000000000000..8c3b661c24cb --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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 IP address that this query experience originated from. + * + * @return the sourceIp value + */ + public String sourceIp() { + return this.sourceIp; + } + + /** + * Set the IP address that this query experience originated from. + * + * @param sourceIp the sourceIp value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + return this; + } + + /** + * Get the approximate latitude that these queries originated from. + * + * @return the latitude value + */ + public Double latitude() { + return this.latitude; + } + + /** + * Set the approximate latitude that these queries originated from. + * + * @param latitude the latitude value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withLatitude(Double latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get the approximate longitude that these queries originated from. + * + * @return the longitude value + */ + public Double longitude() { + return this.longitude; + } + + /** + * Set the approximate longitude that these queries originated from. + * + * @param longitude the longitude value to set + * @return the TrafficFlow object itself. + */ + public TrafficFlow withLongitude(Double longitude) { + this.longitude = longitude; + return this; + } + + /** + * Get the query experiences produced in this HeatMap calculation. + * + * @return the queryExperiences value + */ + public List queryExperiences() { + return this.queryExperiences; + } + + /** + * Set the query experiences produced in this HeatMap calculation. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerGeographicHierarchy.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerGeographicHierarchy.java new file mode 100644 index 000000000000..05cbd80fa7dd --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerGeographicHierarchy.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.TrafficManagerGeographicHierarchyInner; + +/** + * Type representing TrafficManagerGeographicHierarchy. + */ +public interface TrafficManagerGeographicHierarchy extends HasInner, HasManager { + /** + * @return the geographicHierarchy value. + */ + Region geographicHierarchy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerNameAvailability.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerNameAvailability.java new file mode 100644 index 000000000000..10af1a1d511a --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficManagerNameAvailability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.NetworkManager; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation.TrafficManagerNameAvailabilityInner; + +/** + * Type representing TrafficManagerNameAvailability. + */ +public interface TrafficManagerNameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficRoutingMethod.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficRoutingMethod.java new file mode 100644 index 000000000000..3d63a7fb451f --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficRoutingMethod.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrafficRoutingMethod. + */ +public final class TrafficRoutingMethod extends ExpandableStringEnum { + /** Static value Performance for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod PERFORMANCE = fromString("Performance"); + + /** Static value Priority for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod PRIORITY = fromString("Priority"); + + /** Static value Weighted for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod WEIGHTED = fromString("Weighted"); + + /** Static value Geographic for TrafficRoutingMethod. */ + public static final TrafficRoutingMethod GEOGRAPHIC = fromString("Geographic"); + + /** + * Creates or finds a TrafficRoutingMethod from its string representation. + * @param name a name to look for + * @return the corresponding TrafficRoutingMethod + */ + @JsonCreator + public static TrafficRoutingMethod fromString(String name) { + return fromString(name, TrafficRoutingMethod.class); + } + + /** + * @return known TrafficRoutingMethod values + */ + public static Collection values() { + return values(TrafficRoutingMethod.class); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficViewEnrollmentStatus.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/TrafficViewEnrollmentStatus.java new file mode 100644 index 000000000000..9840df185364 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01; + +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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultImpl.java new file mode 100644 index 000000000000..86e03ca72f7c --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.DeleteOperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DeleteOperationResultImpl extends WrapperImpl implements DeleteOperationResult { + private final NetworkManager manager; + DeleteOperationResultImpl(DeleteOperationResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean operationResult() { + return this.inner().operationResult(); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultInner.java new file mode 100644 index 000000000000..a653beb8f4f4 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/DeleteOperationResultInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of the request or operation. + */ +public class DeleteOperationResultInner { + /** + * The result of the operation or request. + */ + @JsonProperty(value = "boolean", access = JsonProperty.Access.WRITE_ONLY) + private Boolean operationResult; + + /** + * Get the result of the operation or request. + * + * @return the operationResult value + */ + public Boolean operationResult() { + return this.operationResult; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointImpl.java new file mode 100644 index 000000000000..1cb52a0b3ff0 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoint; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointPropertiesCustomHeadersItem; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointMonitorStatus; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointStatus; + +class EndpointImpl extends WrapperImpl implements Endpoint { + private final NetworkManager manager; + EndpointImpl(EndpointInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String endpointLocation() { + return this.inner().endpointLocation(); + } + + @Override + public EndpointMonitorStatus endpointMonitorStatus() { + return this.inner().endpointMonitorStatus(); + } + + @Override + public EndpointStatus endpointStatus() { + return this.inner().endpointStatus(); + } + + @Override + public List geoMapping() { + return this.inner().geoMapping(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long minChildEndpoints() { + return this.inner().minChildEndpoints(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long priority() { + return this.inner().priority(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long weight() { + return this.inner().weight(); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointInner.java new file mode 100644 index 000000000000..840d31fe0c72 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointStatus; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointMonitorStatus; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.EndpointPropertiesCustomHeadersItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a Traffic Manager endpoint. + */ +@JsonFlatten +public class EndpointInner extends ProxyResource { + /** + * The Azure Resource URI of the of the endpoint. Not applicable to + * endpoints of type 'ExternalEndpoints'. + */ + @JsonProperty(value = "properties.targetResourceId") + private String targetResourceId; + + /** + * 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; + + /** + * The status of the endpoint. If the endpoint is Enabled, it is probed for + * endpoint health and is included in the traffic routing method. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.endpointStatus") + private EndpointStatus endpointStatus; + + /** + * The weight of this endpoint when using the 'Weighted' traffic routing + * method. Possible values are from 1 to 1000. + */ + @JsonProperty(value = "properties.weight") + private Long weight; + + /** + * The priority of this endpoint when using the ‘Priority’ traffic routing + * method. Possible values are from 1 to 1000, lower values represent + * higher priority. This is an optional parameter. If specified, it must + * be specified on all endpoints, and no two endpoints can share the same + * priority value. + */ + @JsonProperty(value = "properties.priority") + private Long priority; + + /** + * Specifies the location of the external or nested endpoints when using + * the ‘Performance’ traffic routing method. + */ + @JsonProperty(value = "properties.endpointLocation") + private String endpointLocation; + + /** + * The monitoring status of the endpoint. Possible values include: + * 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', + * 'Stopped'. + */ + @JsonProperty(value = "properties.endpointMonitorStatus") + private EndpointMonitorStatus endpointMonitorStatus; + + /** + * The minimum number of endpoints that must be available in the child + * profile in order for the parent profile to be considered available. Only + * applicable to endpoint of type 'NestedEndpoints'. + */ + @JsonProperty(value = "properties.minChildEndpoints") + private Long minChildEndpoints; + + /** + * The list of countries/regions mapped to this endpoint when using the + * ‘Geographic’ traffic routing method. Please consult Traffic Manager + * Geographic documentation for a full list of accepted values. + */ + @JsonProperty(value = "properties.geoMapping") + private List geoMapping; + + /** + * List of custom headers. + */ + @JsonProperty(value = "properties.customHeaders") + private List customHeaders; + + /** + * Get the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. + * + * @param targetResourceId the targetResourceId value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get 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. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set 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. + * + * @param target the target value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values include: 'Enabled', 'Disabled'. + * + * @return the endpointStatus value + */ + public EndpointStatus endpointStatus() { + return this.endpointStatus; + } + + /** + * Set the status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values include: 'Enabled', 'Disabled'. + * + * @param endpointStatus the endpointStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointStatus(EndpointStatus endpointStatus) { + this.endpointStatus = endpointStatus; + return this; + } + + /** + * Get the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @return the weight value + */ + public Long weight() { + return this.weight; + } + + /** + * Set the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. + * + * @param weight the weight value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withWeight(Long weight) { + this.weight = weight; + return this; + } + + /** + * Get the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @return the priority value + */ + public Long priority() { + return this.priority; + } + + /** + * Set the priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value. + * + * @param priority the priority value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withPriority(Long priority) { + this.priority = priority; + return this; + } + + /** + * Get specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @return the endpointLocation value + */ + public String endpointLocation() { + return this.endpointLocation; + } + + /** + * Set specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method. + * + * @param endpointLocation the endpointLocation value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointLocation(String endpointLocation) { + this.endpointLocation = endpointLocation; + return this; + } + + /** + * Get the monitoring status of the endpoint. Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', 'Stopped'. + * + * @return the endpointMonitorStatus value + */ + public EndpointMonitorStatus endpointMonitorStatus() { + return this.endpointMonitorStatus; + } + + /** + * Set the monitoring status of the endpoint. Possible values include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled', 'Inactive', 'Stopped'. + * + * @param endpointMonitorStatus the endpointMonitorStatus value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withEndpointMonitorStatus(EndpointMonitorStatus endpointMonitorStatus) { + this.endpointMonitorStatus = endpointMonitorStatus; + return this; + } + + /** + * Get the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @return the minChildEndpoints value + */ + public Long minChildEndpoints() { + return this.minChildEndpoints; + } + + /** + * Set the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'. + * + * @param minChildEndpoints the minChildEndpoints value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withMinChildEndpoints(Long minChildEndpoints) { + this.minChildEndpoints = minChildEndpoints; + return this; + } + + /** + * Get the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @return the geoMapping value + */ + public List geoMapping() { + return this.geoMapping; + } + + /** + * Set the list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values. + * + * @param geoMapping the geoMapping value to set + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoMapping(List geoMapping) { + this.geoMapping = geoMapping; + return this; + } + + /** + * Get list of custom headers. + * + * @return the customHeaders value + */ + public List customHeaders() { + return this.customHeaders; + } + + /** + * Set list of custom headers. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsImpl.java new file mode 100644 index 000000000000..d979a45afce7 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoints; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoint; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.DeleteOperationResult; + +class EndpointsImpl extends WrapperImpl implements Endpoints { + private final NetworkManager manager; + + EndpointsImpl(NetworkManager manager) { + super(manager.inner().endpoints()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.updateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + EndpointsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters) + .map(new Func1() { + @Override + public Endpoint call(EndpointInner inner) { + return new EndpointImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + EndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, profileName, endpointType, endpointName) + .map(new Func1() { + @Override + public DeleteOperationResult call(DeleteOperationResultInner inner) { + return new DeleteOperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsInner.java new file mode 100644 index 000000000000..7c89f0f5779f --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/EndpointsInner.java @@ -0,0 +1,495 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Endpoints. + */ +public class EndpointsInner { + /** The Retrofit service to perform REST calls. */ + private EndpointsService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of EndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EndpointsInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(EndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Endpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface EndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2018_03_01.Endpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @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.trafficmanager.v2018_03_01.Endpoints createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Body EndpointInner 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.v2018_03_01.Endpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("endpointType") String endpointType, @Path("endpointName") String endpointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner update(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be updated. + * @param endpointName The name of the Traffic Manager endpoint to be updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner get(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable getAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return getWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint. + * @param endpointName The name of the Traffic Manager endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), 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); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EndpointInner object if successful. + */ + public EndpointInner createOrUpdate(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).map(new Func1, EndpointInner>() { + @Override + public EndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be created or updated. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be created or updated. + * @param endpointName The name of the Traffic Manager endpoint to be created or updated. + * @param parameters The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EndpointInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName), serviceCallback); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName, endpointType, endpointName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager endpoint. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager endpoint to be deleted. + * @param profileName The name of the Traffic Manager profile. + * @param endpointType The type of the Traffic Manager endpoint to be deleted. + * @param endpointName The name of the Traffic Manager endpoint to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String endpointType, String endpointName) { + 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 (endpointType == null) { + throw new IllegalArgumentException("Parameter endpointType is required and cannot be null."); + } + if (endpointName == null) { + throw new IllegalArgumentException("Parameter endpointName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, endpointType, endpointName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesImpl.java new file mode 100644 index 000000000000..b7b05566421c --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.GeographicHierarchies; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficManagerGeographicHierarchy; + +class GeographicHierarchiesImpl extends WrapperImpl implements GeographicHierarchies { + private final NetworkManager manager; + + GeographicHierarchiesImpl(NetworkManager manager) { + super(manager.inner().geographicHierarchies()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable getDefaultAsync() { + GeographicHierarchiesInner client = this.inner(); + return client.getDefaultAsync() + .map(new Func1() { + @Override + public TrafficManagerGeographicHierarchy call(TrafficManagerGeographicHierarchyInner inner) { + return new TrafficManagerGeographicHierarchyImpl(inner, manager()); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesInner.java new file mode 100644 index 000000000000..966741ed4551 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/GeographicHierarchiesInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 GeographicHierarchies. + */ +public class GeographicHierarchiesInner { + /** The Retrofit service to perform REST calls. */ + private GeographicHierarchiesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of GeographicHierarchiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GeographicHierarchiesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(GeographicHierarchiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for GeographicHierarchies to be + * 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.v2018_03_01.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); + + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerGeographicHierarchyInner object if successful. + */ + public TrafficManagerGeographicHierarchyInner getDefault() { + return getDefaultWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable getDefaultAsync() { + return getDefaultWithServiceResponseAsync().map(new Func1, TrafficManagerGeographicHierarchyInner>() { + @Override + public TrafficManagerGeographicHierarchyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the default Geographic Hierarchy used by the Geographic traffic routing method. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerGeographicHierarchyInner object + */ + public Observable> getDefaultWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDefault(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultDelegate(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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelImpl.java new file mode 100644 index 000000000000..81e0eddf1ec3 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMapModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMapEndpoint; +import org.joda.time.DateTime; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficFlow; + +class HeatMapModelImpl extends IndexableRefreshableWrapperImpl implements HeatMapModel { + private final NetworkManager manager; + private String resourceGroupName; + private String profileName; + + HeatMapModelImpl(HeatMapModelInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.profileName = IdParsingUtils.getValueFromIdByName(inner.id(), "trafficmanagerprofiles"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + HeatMapsInner client = this.manager().inner().heatMaps(); + return client.getAsync(this.resourceGroupName, this.profileName); + } + + + + @Override + public List endpoints() { + return this.inner().endpoints(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public List trafficFlows() { + return this.inner().trafficFlows(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelInner.java new file mode 100644 index 000000000000..003529760768 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapModelInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMapEndpoint; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficFlow; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a Traffic Manager HeatMap. + */ +@JsonFlatten +public class HeatMapModelInner extends ProxyResource { + /** + * 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 beginning of the time window for this HeatMap, inclusive. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the beginning of the time window for this HeatMap, inclusive. + * + * @param startTime the startTime value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the ending of the time window for this HeatMap, exclusive. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the ending of the time window for this HeatMap, exclusive. + * + * @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 used in this HeatMap calculation. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints used in this HeatMap calculation. + * + * @param endpoints the endpoints value to set + * @return the HeatMapModelInner object itself. + */ + public HeatMapModelInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the traffic flows produced in this HeatMap calculation. + * + * @return the trafficFlows value + */ + public List trafficFlows() { + return this.trafficFlows; + } + + /** + * Set the traffic flows produced in this HeatMap calculation. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapsImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapsImpl.java new file mode 100644 index 000000000000..e3ee3ab6a97a --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMaps; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMapModel; + +class HeatMapsImpl extends WrapperImpl implements HeatMaps { + private final NetworkManager manager; + + HeatMapsImpl(NetworkManager manager) { + super(manager.inner().heatMaps()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private HeatMapModelImpl wrapModel(HeatMapModelInner inner) { + return new HeatMapModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String profileName) { + HeatMapsInner client = this.inner(); + return client.getAsync(resourceGroupName, profileName) + .map(new Func1() { + @Override + public HeatMapModel call(HeatMapModelInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapsInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/HeatMapsInner.java new file mode 100644 index 000000000000..28b5ece6bd35 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/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.v2018_03_01.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.v2018_03_01.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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/IdParsingUtils.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..453bc906ff75 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/NetworkManager.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/NetworkManager.java new file mode 100644 index 000000000000..66328ebc516b --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/NetworkManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoints; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.GeographicHierarchies; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.HeatMaps; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private Endpoints endpoints; + private Profiles profiles; + private GeographicHierarchies geographicHierarchies; + private HeatMaps heatMaps; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(this); + } + return this.endpoints; + } + + /** + * @return Entry point to manage Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(this); + } + return this.profiles; + } + + /** + * @return Entry point to manage GeographicHierarchies. + */ + public GeographicHierarchies geographicHierarchies() { + if (this.geographicHierarchies == null) { + this.geographicHierarchies = new GeographicHierarchiesImpl(this); + } + return this.geographicHierarchies; + } + + /** + * @return Entry point to manage HeatMaps. + */ + public HeatMaps heatMaps() { + if (this.heatMaps == null) { + this.heatMaps = new HeatMapsImpl(this); + } + return this.heatMaps; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new TrafficManagerManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/PageImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/PageImpl.java new file mode 100644 index 000000000000..3f7df5885f70 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileImpl.java new file mode 100644 index 000000000000..f7456eb46ae8 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Profile; +import rx.Observable; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.ProfileStatus; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficRoutingMethod; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.MonitorConfig; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficViewEnrollmentStatus; +import java.util.ArrayList; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Endpoint; + +class ProfileImpl extends GroupableResourceCoreImpl implements Profile, Profile.Definition, Profile.Update { + ProfileImpl(String name, ProfileInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProfilesInner client = this.manager().inner().profiles(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DnsConfig dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public List endpoints() { + List lst = new ArrayList(); + if (this.inner().endpoints() != null) { + for (EndpointInner inner : this.inner().endpoints()) { + lst.add( new EndpointImpl(inner, manager())); + } + } + return lst; + } + + @Override + public MonitorConfig monitorConfig() { + return this.inner().monitorConfig(); + } + + @Override + public ProfileStatus profileStatus() { + return this.inner().profileStatus(); + } + + @Override + public TrafficRoutingMethod trafficRoutingMethod() { + return this.inner().trafficRoutingMethod(); + } + + @Override + public TrafficViewEnrollmentStatus trafficViewEnrollmentStatus() { + return this.inner().trafficViewEnrollmentStatus(); + } + + @Override + public ProfileImpl withDnsConfig(DnsConfig dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ProfileImpl withEndpoints(List endpoints) { + this.inner().withEndpoints(endpoints); + return this; + } + + @Override + public ProfileImpl withMonitorConfig(MonitorConfig monitorConfig) { + this.inner().withMonitorConfig(monitorConfig); + return this; + } + + @Override + public ProfileImpl withProfileStatus(ProfileStatus profileStatus) { + this.inner().withProfileStatus(profileStatus); + return this; + } + + @Override + public ProfileImpl withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod) { + this.inner().withTrafficRoutingMethod(trafficRoutingMethod); + return this; + } + + @Override + public ProfileImpl withTrafficViewEnrollmentStatus(TrafficViewEnrollmentStatus trafficViewEnrollmentStatus) { + this.inner().withTrafficViewEnrollmentStatus(trafficViewEnrollmentStatus); + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileInner.java new file mode 100644 index 000000000000..5fa48d9a38ca --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfileInner.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.ProfileStatus; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficRoutingMethod; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.DnsConfig; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.MonitorConfig; +import java.util.List; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficViewEnrollmentStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Class representing a Traffic Manager profile. + */ +@JsonFlatten +@SkipParentValidation +public class ProfileInner extends Resource { + /** + * The status of the Traffic Manager profile. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.profileStatus") + private ProfileStatus profileStatus; + + /** + * The traffic routing method of the Traffic Manager profile. Possible + * values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + */ + @JsonProperty(value = "properties.trafficRoutingMethod") + private TrafficRoutingMethod trafficRoutingMethod; + + /** + * The DNS settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfig dnsConfig; + + /** + * The endpoint monitoring settings of the Traffic Manager profile. + */ + @JsonProperty(value = "properties.monitorConfig") + private MonitorConfig monitorConfig; + + /** + * The list of endpoints in the Traffic Manager profile. + */ + @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 status of the Traffic Manager profile. Possible values include: 'Enabled', 'Disabled'. + * + * @return the profileStatus value + */ + public ProfileStatus profileStatus() { + return this.profileStatus; + } + + /** + * Set the status of the Traffic Manager profile. Possible values include: 'Enabled', 'Disabled'. + * + * @param profileStatus the profileStatus value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withProfileStatus(ProfileStatus profileStatus) { + this.profileStatus = profileStatus; + return this; + } + + /** + * Get the traffic routing method of the Traffic Manager profile. Possible values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + * + * @return the trafficRoutingMethod value + */ + public TrafficRoutingMethod trafficRoutingMethod() { + return this.trafficRoutingMethod; + } + + /** + * Set the traffic routing method of the Traffic Manager profile. Possible values include: 'Performance', 'Priority', 'Weighted', 'Geographic'. + * + * @param trafficRoutingMethod the trafficRoutingMethod value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withTrafficRoutingMethod(TrafficRoutingMethod trafficRoutingMethod) { + this.trafficRoutingMethod = trafficRoutingMethod; + return this; + } + + /** + * Get the DNS settings of the Traffic Manager profile. + * + * @return the dnsConfig value + */ + public DnsConfig dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the DNS settings of the Traffic Manager profile. + * + * @param dnsConfig the dnsConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withDnsConfig(DnsConfig dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the endpoint monitoring settings of the Traffic Manager profile. + * + * @return the monitorConfig value + */ + public MonitorConfig monitorConfig() { + return this.monitorConfig; + } + + /** + * Set the endpoint monitoring settings of the Traffic Manager profile. + * + * @param monitorConfig the monitorConfig value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withMonitorConfig(MonitorConfig monitorConfig) { + this.monitorConfig = monitorConfig; + return this; + } + + /** + * Get the list of endpoints in the Traffic Manager profile. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the list of endpoints in the Traffic Manager profile. + * + * @param endpoints the endpoints value to set + * @return the ProfileInner object itself. + */ + public ProfileInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get 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'. + * + * @return the trafficViewEnrollmentStatus value + */ + public TrafficViewEnrollmentStatus trafficViewEnrollmentStatus() { + return this.trafficViewEnrollmentStatus; + } + + /** + * Set 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'. + * + * @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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesImpl.java new file mode 100644 index 000000000000..b60b979be315 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Profiles; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Profile; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficManagerNameAvailability; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.CheckTrafficManagerRelativeDnsNameAvailabilityParameters; + +class ProfilesImpl extends GroupableResourcesCoreImpl implements Profiles { + protected ProfilesImpl(NetworkManager manager) { + super(manager.inner().profiles(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ProfilesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ProfilesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ProfilesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ProfilesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Profile call(ProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ProfileImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + ProfilesInner client = this.inner(); + return client.checkTrafficManagerRelativeDnsNameAvailabilityAsync(parameters) + .map(new Func1() { + @Override + public TrafficManagerNameAvailability call(TrafficManagerNameAvailabilityInner inner) { + return new TrafficManagerNameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + protected ProfileImpl wrapModel(ProfileInner inner) { + return new ProfileImpl(inner.name(), inner, manager()); + } + + @Override + protected ProfileImpl wrapModel(String name) { + return new ProfileImpl(name, new ProfileInner(), this.manager()); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesInner.java new file mode 100644 index 000000000000..52f6ce1283ff --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/ProfilesInner.java @@ -0,0 +1,705 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.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; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Profiles. + */ +public class ProfilesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ProfilesService service; + /** The service client containing this operation class. */ + private TrafficManagerManagementClientImpl client; + + /** + * Initializes an instance of ProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProfilesInner(Retrofit retrofit, TrafficManagerManagementClientImpl client) { + this.service = retrofit.create(ProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Profiles to be + * used by Retrofit to perform actually REST calls. + */ + interface ProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2018_03_01.Profiles checkTrafficManagerRelativeDnsNameAvailability" }) + @POST("providers/Microsoft.Network/checkTrafficManagerNameAvailability") + 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.v2018_03_01.Profiles listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2018_03_01.Profiles list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.trafficmanager.v2018_03_01.Profiles getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2018_03_01.Profiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner 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.v2018_03_01.Profiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.trafficmanager.v2018_03_01.Profiles update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("subscriptionId") String subscriptionId, @Body ProfileInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrafficManagerNameAvailabilityInner object if successful. + */ + public TrafficManagerNameAvailabilityInner checkTrafficManagerRelativeDnsNameAvailability(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable checkTrafficManagerRelativeDnsNameAvailabilityAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + return checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, TrafficManagerNameAvailabilityInner>() { + @Override + public TrafficManagerNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the availability of a Traffic Manager Relative DNS name. + * + * @param parameters The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrafficManagerNameAvailabilityInner object + */ + public Observable> checkTrafficManagerRelativeDnsNameAvailabilityWithServiceResponseAsync(CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters) { + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.checkTrafficManagerRelativeDnsNameAvailability(parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkTrafficManagerRelativeDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkTrafficManagerRelativeDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * 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. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profiles to be listed. + * @return the observable to the List<ProfileInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * 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. + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Traffic Manager profiles within a subscription. + * + * @return the observable to the List<ProfileInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 ProfileInner object if successful. + */ + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @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 getByResourceGroupAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner createOrUpdate(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeleteOperationResultInner object if successful. + */ + public DeleteOperationResultInner delete(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).toBlocking().single().body(); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String profileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName), serviceCallback); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable deleteAsync(String resourceGroupName, String profileName) { + return deleteWithServiceResponseAsync(resourceGroupName, profileName).map(new Func1, DeleteOperationResultInner>() { + @Override + public DeleteOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted. + * @param profileName The name of the Traffic Manager profile to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeleteOperationResultInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String profileName) { + 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProfileInner object if successful. + */ + public ProfileInner update(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).toBlocking().single().body(); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String profileName, ProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, parameters), serviceCallback); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable updateAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, profileName, parameters).map(new Func1, ProfileInner>() { + @Override + public ProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Traffic Manager profile. + * + * @param resourceGroupName The name of the resource group containing the Traffic Manager profile. + * @param profileName The name of the Traffic Manager profile. + * @param parameters The Traffic Manager profile parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProfileInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String profileName, ProfileInner parameters) { + 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.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, profileName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java new file mode 100644 index 000000000000..128284f2e664 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficManagerGeographicHierarchy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Region; + +class TrafficManagerGeographicHierarchyImpl extends WrapperImpl implements TrafficManagerGeographicHierarchy { + private final NetworkManager manager; + TrafficManagerGeographicHierarchyImpl(TrafficManagerGeographicHierarchyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Region geographicHierarchy() { + return this.inner().geographicHierarchy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyInner.java new file mode 100644 index 000000000000..f628b220c485 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerGeographicHierarchyInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.Region; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing the Geographic hierarchy used with the Geographic traffic + * routing method. + */ +@JsonFlatten +public class TrafficManagerGeographicHierarchyInner extends ProxyResource { + /** + * The region at the root of the hierarchy from all the regions in the + * hierarchy can be retrieved. + */ + @JsonProperty(value = "properties.geographicHierarchy") + private Region geographicHierarchy; + + /** + * Get the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @return the geographicHierarchy value + */ + public Region geographicHierarchy() { + return this.geographicHierarchy; + } + + /** + * Set the region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. + * + * @param geographicHierarchy the geographicHierarchy value to set + * @return the TrafficManagerGeographicHierarchyInner object itself. + */ + public TrafficManagerGeographicHierarchyInner withGeographicHierarchy(Region geographicHierarchy) { + this.geographicHierarchy = geographicHierarchy; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerManagementClientImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerManagementClientImpl.java new file mode 100644 index 000000000000..8b21c9b4c536 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the TrafficManagerManagementClientImpl class. + */ +public class TrafficManagerManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public TrafficManagerManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The EndpointsInner object to access its operations. + */ + private EndpointsInner endpoints; + + /** + * Gets the EndpointsInner object to access its operations. + * @return the EndpointsInner object. + */ + public EndpointsInner endpoints() { + return this.endpoints; + } + + /** + * The ProfilesInner object to access its operations. + */ + private ProfilesInner profiles; + + /** + * Gets the ProfilesInner object to access its operations. + * @return the ProfilesInner object. + */ + public ProfilesInner profiles() { + return this.profiles; + } + + /** + * The GeographicHierarchiesInner object to access its operations. + */ + private GeographicHierarchiesInner geographicHierarchies; + + /** + * Gets the GeographicHierarchiesInner object to access its operations. + * @return the GeographicHierarchiesInner object. + */ + 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. + * + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public TrafficManagerManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of TrafficManagerManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public TrafficManagerManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + 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); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "TrafficManagerManagementClient", "2018-03-01"); + } +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityImpl.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityImpl.java new file mode 100644 index 000000000000..6e2d9da3071a --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_03_01.implementation; + +import com.microsoft.azure.management.trafficmanager.v2018_03_01.TrafficManagerNameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TrafficManagerNameAvailabilityImpl extends WrapperImpl implements TrafficManagerNameAvailability { + private final NetworkManager manager; + TrafficManagerNameAvailabilityImpl(TrafficManagerNameAvailabilityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityInner.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityInner.java new file mode 100644 index 000000000000..820d8764b0d3 --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/TrafficManagerNameAvailabilityInner.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing a Traffic Manager Name Availability response. + */ +public class TrafficManagerNameAvailabilityInner { + /** + * The relative name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Traffic Manager profile resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Describes whether the relative name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason why the name is not available, when applicable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Descriptive message that explains why the name is not available, when + * applicable. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the relative name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the relative name. + * + * @param name the name value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get traffic Manager profile resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set traffic Manager profile resource type. + * + * @param type the type value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get describes whether the relative name is available or not. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set describes whether the relative name is available or not. + * + * @param nameAvailable the nameAvailable value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason why the name is not available, when applicable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason why the name is not available, when applicable. + * + * @param reason the reason value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get descriptive message that explains why the name is not available, when applicable. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set descriptive message that explains why the name is not available, when applicable. + * + * @param message the message value to set + * @return the TrafficManagerNameAvailabilityInner object itself. + */ + public TrafficManagerNameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/package-info.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/package-info.java new file mode 100644 index 000000000000..dcb57a4c13dc --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2018_03_01.implementation; diff --git a/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/package-info.java b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/package-info.java new file mode 100644 index 000000000000..d5aaea92bccb --- /dev/null +++ b/trafficmanager/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/trafficmanager/v2018_03_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for TrafficManagerManagementClient. + */ +package com.microsoft.azure.management.trafficmanager.v2018_03_01;