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