diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/DefaultName.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/DefaultName.java new file mode 100644 index 00000000000..03adbbdb408 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/DefaultName.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DefaultName. + */ +public enum DefaultName { + /** Enum value Microsoft.Cache/redis. */ + MICROSOFT_CACHEREDIS("Microsoft.Cache/redis"); + + /** The actual serialized value for a DefaultName instance. */ + private String value; + + DefaultName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultName instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultName object, or null if unable to parse. + */ + @JsonCreator + public static DefaultName fromString(String value) { + DefaultName[] items = DefaultName.values(); + for (DefaultName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/OperationDisplay.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/OperationDisplay.java new file mode 100644 index 00000000000..a8b97332654 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.redis; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Operation type: read, write, delete, listKeys/action, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Friendly name of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation value. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ProvisioningState.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ProvisioningState.java new file mode 100644 index 00000000000..f634c535d71 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ProvisioningState.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.redis; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Disabled for ProvisioningState. */ + public static final ProvisioningState DISABLED = fromString("Disabled"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Linking for ProvisioningState. */ + public static final ProvisioningState LINKING = fromString("Linking"); + + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value RecoveringScaleFailure for ProvisioningState. */ + public static final ProvisioningState RECOVERING_SCALE_FAILURE = fromString("RecoveringScaleFailure"); + + /** Static value Scaling for ProvisioningState. */ + public static final ProvisioningState SCALING = fromString("Scaling"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Unlinking for ProvisioningState. */ + public static final ProvisioningState UNLINKING = fromString("Unlinking"); + + /** Static value Unprovisioning for ProvisioningState. */ + public static final ProvisioningState UNPROVISIONING = fromString("Unprovisioning"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RebootType.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RebootType.java index 4137bf1e93d..8a50b4a4fe2 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RebootType.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RebootType.java @@ -8,55 +8,37 @@ package com.microsoft.azure.management.redis; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for RebootType. */ -public final class RebootType { +public final class RebootType extends ExpandableStringEnum { /** Static value PrimaryNode for RebootType. */ - public static final RebootType PRIMARY_NODE = new RebootType("PrimaryNode"); + public static final RebootType PRIMARY_NODE = fromString("PrimaryNode"); /** Static value SecondaryNode for RebootType. */ - public static final RebootType SECONDARY_NODE = new RebootType("SecondaryNode"); + public static final RebootType SECONDARY_NODE = fromString("SecondaryNode"); /** Static value AllNodes for RebootType. */ - public static final RebootType ALL_NODES = new RebootType("AllNodes"); - - private String value; + public static final RebootType ALL_NODES = fromString("AllNodes"); /** - * Creates a custom value for RebootType. - * @param value the custom value + * Creates or finds a RebootType from its string representation. + * @param name a name to look for + * @return the corresponding RebootType */ - public RebootType(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static RebootType fromString(String name) { + return fromString(name, RebootType.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof RebootType)) { - return false; - } - if (obj == this) { - return true; - } - RebootType rhs = (RebootType) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known RebootType values + */ + public static Collection values() { + return values(RebootType.class); } } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisLinkedServer.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisLinkedServer.java new file mode 100644 index 00000000000..cbdf4645058 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/RedisLinkedServer.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Linked server Id. + */ +public class RedisLinkedServer { + /** + * Linked server Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ReplicationRole.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ReplicationRole.java new file mode 100644 index 00000000000..e9cff111c7d --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/ReplicationRole.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ReplicationRole. + */ +public enum ReplicationRole { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a ReplicationRole instance. */ + private String value; + + ReplicationRole(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReplicationRole instance. + * + * @param value the serialized value to parse. + * @return the parsed ReplicationRole object, or null if unable to parse. + */ + @JsonCreator + public static ReplicationRole fromString(String value) { + ReplicationRole[] items = ReplicationRole.values(); + for (ReplicationRole item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuFamily.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuFamily.java index 4027ed51be4..ec31cc52207 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuFamily.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuFamily.java @@ -8,52 +8,34 @@ package com.microsoft.azure.management.redis; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for SkuFamily. */ -public final class SkuFamily { +public final class SkuFamily extends ExpandableStringEnum { /** Static value C for SkuFamily. */ - public static final SkuFamily C = new SkuFamily("C"); + public static final SkuFamily C = fromString("C"); /** Static value P for SkuFamily. */ - public static final SkuFamily P = new SkuFamily("P"); - - private String value; + public static final SkuFamily P = fromString("P"); /** - * Creates a custom value for SkuFamily. - * @param value the custom value + * Creates or finds a SkuFamily from its string representation. + * @param name a name to look for + * @return the corresponding SkuFamily */ - public SkuFamily(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static SkuFamily fromString(String name) { + return fromString(name, SkuFamily.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof SkuFamily)) { - return false; - } - if (obj == this) { - return true; - } - SkuFamily rhs = (SkuFamily) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known SkuFamily values + */ + public static Collection values() { + return values(SkuFamily.class); } } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuName.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuName.java index ebaa7dfd889..600660079f8 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuName.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuName.java @@ -8,55 +8,37 @@ package com.microsoft.azure.management.redis; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for SkuName. */ -public final class SkuName { +public final class SkuName extends ExpandableStringEnum { /** Static value Basic for SkuName. */ - public static final SkuName BASIC = new SkuName("Basic"); + public static final SkuName BASIC = fromString("Basic"); /** Static value Standard for SkuName. */ - public static final SkuName STANDARD = new SkuName("Standard"); + public static final SkuName STANDARD = fromString("Standard"); /** Static value Premium for SkuName. */ - public static final SkuName PREMIUM = new SkuName("Premium"); - - private String value; + public static final SkuName PREMIUM = fromString("Premium"); /** - * Creates a custom value for SkuName. - * @param value the custom value + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName */ - public SkuName(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return value; + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); } - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof SkuName)) { - return false; - } - if (obj == this) { - return true; - } - SkuName rhs = (SkuName) obj; - if (value == null) { - return rhs.value == null; - } else { - return value.equals(rhs.value); - } + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); } } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/TlsVersion.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/TlsVersion.java new file mode 100644 index 00000000000..c6dd6022dbe --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/TlsVersion.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TlsVersion. + */ +public final class TlsVersion extends ExpandableStringEnum { + /** Static value 1.0 for TlsVersion. */ + public static final TlsVersion ONE_FULL_STOP_ZERO = fromString("1.0"); + + /** Static value 1.1 for TlsVersion. */ + public static final TlsVersion ONE_FULL_STOP_ONE = fromString("1.1"); + + /** Static value 1.2 for TlsVersion. */ + public static final TlsVersion ONE_FULL_STOP_TWO = fromString("1.2"); + + /** + * Creates or finds a TlsVersion from its string representation. + * @param name a name to look for + * @return the corresponding TlsVersion + */ + @JsonCreator + public static TlsVersion fromString(String name) { + return fromString(name, TlsVersion.class); + } + + /** + * @return known TlsVersion values + */ + public static Collection values() { + return values(TlsVersion.class); + } +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/UpgradeNotification.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/UpgradeNotification.java new file mode 100644 index 00000000000..7804fb88669 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/UpgradeNotification.java @@ -0,0 +1,64 @@ +/** + * 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.redis; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of upgrade notification. + */ +public class UpgradeNotification { + /** + * Name of upgrade notification. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Timestamp when upgrade notification occured. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Details about this upgrade notification. + */ + @JsonProperty(value = "upsellNotification", access = JsonProperty.Access.WRITE_ONLY) + private Map upsellNotification; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the timestamp value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get the upsellNotification value. + * + * @return the upsellNotification value + */ + public Map upsellNotification() { + return this.upsellNotification; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/CheckNameAvailabilityParametersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/CheckNameAvailabilityParametersInner.java new file mode 100644 index 00000000000..31162fcb646 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/CheckNameAvailabilityParametersInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters body to pass for resource name availability check. + */ +public class CheckNameAvailabilityParametersInner { + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type. The only legal value of this property for checking redis + * cache name availability is 'Microsoft.Cache/redis'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParametersInner object itself. + */ + public CheckNameAvailabilityParametersInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParametersInner object itself. + */ + public CheckNameAvailabilityParametersInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/FirewallRulesInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/FirewallRulesInner.java new file mode 100644 index 00000000000..53dfd1de161 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/FirewallRulesInner.java @@ -0,0 +1,608 @@ +/** + * 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.redis.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.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.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in FirewallRules. + */ +public class FirewallRulesInner { + /** The Retrofit service to perform REST calls. */ + private FirewallRulesService service; + /** The service client containing this operation class. */ + private RedisManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FirewallRulesInner(Retrofit retrofit, RedisManagementClientImpl client) { + this.service = retrofit.create(FirewallRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FirewallRules to be + * used by Retrofit to perform actually REST calls. + */ + interface FirewallRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.FirewallRules listByRedisResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules") + Observable> listByRedisResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @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.redis.FirewallRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RedisFirewallRuleCreateParametersInner 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.redis.FirewallRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("ruleName") String ruleName, @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.redis.FirewallRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("ruleName") String ruleName, @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.redis.FirewallRules listByRedisResourceNext" }) + @GET + Observable> listByRedisResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RedisFirewallRuleInner> object if successful. + */ + public PagedList listByRedisResource(final String resourceGroupName, final String cacheName) { + ServiceResponse> response = listByRedisResourceSinglePageAsync(resourceGroupName, cacheName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @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> listByRedisResourceAsync(final String resourceGroupName, final String cacheName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRedisResourceSinglePageAsync(resourceGroupName, cacheName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisFirewallRuleInner> object + */ + public Observable> listByRedisResourceAsync(final String resourceGroupName, final String cacheName) { + return listByRedisResourceWithServiceResponseAsync(resourceGroupName, cacheName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisFirewallRuleInner> object + */ + public Observable>> listByRedisResourceWithServiceResponseAsync(final String resourceGroupName, final String cacheName) { + return listByRedisResourceSinglePageAsync(resourceGroupName, cacheName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRedisResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisFirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRedisResourceSinglePageAsync(final String resourceGroupName, final String cacheName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.listByRedisResource(this.client.subscriptionId(), resourceGroupName, cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRedisResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRedisResourceDelegate(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); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 RedisFirewallRuleInner object if successful. + */ + public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParametersInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, ruleName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 cacheName, String ruleName, RedisFirewallRuleCreateParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, ruleName, parameters), serviceCallback); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisFirewallRuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParametersInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, ruleName, parameters).map(new Func1, RedisFirewallRuleInner>() { + @Override + public RedisFirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisFirewallRuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParametersInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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, cacheName, ruleName, 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); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @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 RedisFirewallRuleInner object if successful. + */ + public RedisFirewallRuleInner get(String resourceGroupName, String cacheName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, cacheName, ruleName).toBlocking().single().body(); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @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 cacheName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, cacheName, ruleName), serviceCallback); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisFirewallRuleInner object + */ + public Observable getAsync(String resourceGroupName, String cacheName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, cacheName, ruleName).map(new Func1, RedisFirewallRuleInner>() { + @Override + public RedisFirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisFirewallRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String cacheName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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, cacheName, ruleName, 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); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @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 cacheName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, cacheName, ruleName).toBlocking().single().body(); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @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 cacheName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, cacheName, ruleName), serviceCallback); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String cacheName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, cacheName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String cacheName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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, cacheName, ruleName, 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); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RedisFirewallRuleInner> object if successful. + */ + public PagedList listByRedisResourceNext(final String nextPageLink) { + ServiceResponse> response = listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRedisResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRedisResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisFirewallRuleInner> object + */ + public Observable> listByRedisResourceNextAsync(final String nextPageLink) { + return listByRedisResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisFirewallRuleInner> object + */ + public Observable>> listByRedisResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRedisResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisFirewallRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRedisResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRedisResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRedisResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRedisResourceNextDelegate(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); + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/LinkedServersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/LinkedServersInner.java new file mode 100644 index 00000000000..0e2e3fb640c --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/LinkedServersInner.java @@ -0,0 +1,695 @@ +/** + * 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.redis.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.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.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LinkedServers. + */ +public class LinkedServersInner { + /** The Retrofit service to perform REST calls. */ + private LinkedServersService service; + /** The service client containing this operation class. */ + private RedisManagementClientImpl client; + + /** + * Initializes an instance of LinkedServersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LinkedServersInner(Retrofit retrofit, RedisManagementClientImpl client) { + this.service = retrofit.create(LinkedServersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LinkedServers to be + * used by Retrofit to perform actually REST calls. + */ + interface LinkedServersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.LinkedServers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("linkedServerName") String linkedServerName, @Path("subscriptionId") String subscriptionId, @Body RedisLinkedServerCreateParametersInner 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.redis.LinkedServers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("linkedServerName") String linkedServerName, @Path("subscriptionId") String subscriptionId, @Body RedisLinkedServerCreateParametersInner 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.redis.LinkedServers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("linkedServerName") String linkedServerName, @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.redis.LinkedServers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("linkedServerName") String linkedServerName, @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.redis.LinkedServers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.redis.LinkedServers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server 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 RedisLinkedServerWithPropertiesInner object if successful. + */ + public RedisLinkedServerWithPropertiesInner create(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters).toBlocking().last().body(); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server 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 createAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters), serviceCallback); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters).map(new Func1, RedisLinkedServerWithPropertiesInner>() { + @Override + public RedisLinkedServerWithPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (linkedServerName == null) { + throw new IllegalArgumentException("Parameter linkedServerName 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); + Observable> observable = service.create(resourceGroupName, name, linkedServerName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server 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 RedisLinkedServerWithPropertiesInner object if successful. + */ + public RedisLinkedServerWithPropertiesInner beginCreate(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters).toBlocking().single().body(); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server 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 beginCreateAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters), serviceCallback); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisLinkedServerWithPropertiesInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters).map(new Func1, RedisLinkedServerWithPropertiesInner>() { + @Override + public RedisLinkedServerWithPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Linked server operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisLinkedServerWithPropertiesInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParametersInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (linkedServerName == null) { + throw new IllegalArgumentException("Parameter linkedServerName 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.beginCreate(resourceGroupName, name, linkedServerName, 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 = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(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 the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @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 name, String linkedServerName) { + deleteWithServiceResponseAsync(resourceGroupName, name, linkedServerName).toBlocking().single().body(); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @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 name, String linkedServerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name, linkedServerName), serviceCallback); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String name, String linkedServerName) { + return deleteWithServiceResponseAsync(resourceGroupName, name, linkedServerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name, String linkedServerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (linkedServerName == null) { + throw new IllegalArgumentException("Parameter linkedServerName 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, name, linkedServerName, 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()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server. + * @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 RedisLinkedServerWithPropertiesInner object if successful. + */ + public RedisLinkedServerWithPropertiesInner get(String resourceGroupName, String name, String linkedServerName) { + return getWithServiceResponseAsync(resourceGroupName, name, linkedServerName).toBlocking().single().body(); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server. + * @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 name, String linkedServerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, name, linkedServerName), serviceCallback); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisLinkedServerWithPropertiesInner object + */ + public Observable getAsync(String resourceGroupName, String name, String linkedServerName) { + return getWithServiceResponseAsync(resourceGroupName, name, linkedServerName).map(new Func1, RedisLinkedServerWithPropertiesInner>() { + @Override + public RedisLinkedServerWithPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RedisLinkedServerWithPropertiesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String name, String linkedServerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (linkedServerName == null) { + throw new IllegalArgumentException("Parameter linkedServerName 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, name, linkedServerName, 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); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RedisLinkedServerWithPropertiesInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String name) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, name).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, name), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisLinkedServerWithPropertiesInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String name) { + return listWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisLinkedServerWithPropertiesInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String name) { + return listSinglePageAsync(resourceGroupName, name) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param name The name of the redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisLinkedServerWithPropertiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name 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.list(resourceGroupName, name, 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } 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 the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RedisLinkedServerWithPropertiesInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisLinkedServerWithPropertiesInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisLinkedServerWithPropertiesInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisLinkedServerWithPropertiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(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); + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/NotificationListResponseInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/NotificationListResponseInner.java new file mode 100644 index 00000000000..7fb5f25ac2b --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/NotificationListResponseInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis.implementation; + +import java.util.List; +import com.microsoft.azure.management.redis.UpgradeNotification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response of listUpgradeNotifications. + */ +public class NotificationListResponseInner { + /** + * List of all notifications. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Link for next set of notifications. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the NotificationListResponseInner object itself. + */ + public NotificationListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationInner.java new file mode 100644 index 00000000000..0333fa64492 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis.implementation; + +import com.microsoft.azure.management.redis.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationsInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationsInner.java new file mode 100644 index 00000000000..d4a1497195f --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.redis.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private RedisManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, RedisManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.Operations list" }) + @GET("providers/Microsoft.Cache/operations") + Observable> list(@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.redis.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } 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); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(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); + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java index 3dd4a333cc4..4885ffc79f1 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java @@ -11,7 +11,11 @@ import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -27,6 +31,7 @@ import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -57,20 +62,151 @@ public PatchSchedulesInner(Retrofit retrofit, RedisManagementClientImpl client) * used by Retrofit to perform actually REST calls. */ interface PatchSchedulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.PatchSchedules listByRedisResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/patchSchedules") + Observable> listByRedisResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @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.redis.PatchSchedules createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RedisPatchScheduleInner parameters, @Header("User-Agent") String userAgent); + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("default") String defaultParameter, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RedisPatchScheduleInner parameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.PatchSchedules delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("default") String defaultParameter, @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.redis.PatchSchedules get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default") - Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("default") String defaultParameter, @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.redis.PatchSchedules listByRedisResourceNext" }) + @GET + Observable> listByRedisResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RedisPatchScheduleInner> object if successful. + */ + public PagedList listByRedisResource(final String resourceGroupName, final String cacheName) { + ServiceResponse> response = listByRedisResourceSinglePageAsync(resourceGroupName, cacheName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @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> listByRedisResourceAsync(final String resourceGroupName, final String cacheName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRedisResourceSinglePageAsync(resourceGroupName, cacheName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisPatchScheduleInner> object + */ + public Observable> listByRedisResourceAsync(final String resourceGroupName, final String cacheName) { + return listByRedisResourceWithServiceResponseAsync(resourceGroupName, cacheName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisPatchScheduleInner> object + */ + public Observable>> listByRedisResourceWithServiceResponseAsync(final String resourceGroupName, final String cacheName) { + return listByRedisResourceSinglePageAsync(resourceGroupName, cacheName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRedisResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisPatchScheduleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRedisResourceSinglePageAsync(final String resourceGroupName, final String cacheName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.listByRedisResource(this.client.subscriptionId(), resourceGroupName, cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRedisResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRedisResourceDelegate(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); + } + /** * Create or replace the patching schedule for Redis cache (requires Premium SKU). * @@ -144,9 +280,10 @@ public Observable> createOrUpdateWithSe throw new IllegalArgumentException("Parameter scheduleEntries is required and cannot be null."); } Validator.validate(scheduleEntries); + final String defaultParameter = "default"; RedisPatchScheduleInner parameters = new RedisPatchScheduleInner(); parameters.withScheduleEntries(scheduleEntries); - return service.createOrUpdate(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + return service.createOrUpdate(resourceGroupName, name, defaultParameter, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -232,7 +369,8 @@ public Observable> deleteWithServiceResponseAsync(String r if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.delete(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String defaultParameter = "default"; + return service.delete(resourceGroupName, name, defaultParameter, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -319,7 +457,8 @@ public Observable> getWithServiceRespon if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.get(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String defaultParameter = "default"; + return service.get(resourceGroupName, name, defaultParameter, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -340,4 +479,115 @@ private ServiceResponse getDelegate(Response listByRedisResourceNext(final String nextPageLink) { + ServiceResponse> response = listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByRedisResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRedisResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisPatchScheduleInner> object + */ + public Observable> listByRedisResourceNextAsync(final String nextPageLink) { + return listByRedisResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RedisPatchScheduleInner> object + */ + public Observable>> listByRedisResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listByRedisResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRedisResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RedisPatchScheduleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRedisResourceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRedisResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRedisResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRedisResourceNextDelegate(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); + } + } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/ProxyResourceInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/ProxyResourceInner.java new file mode 100644 index 00000000000..34d0d9df80d --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/ProxyResourceInner.java @@ -0,0 +1,18 @@ +/** + * 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.redis.implementation; + +import com.microsoft.azure.Resource; + +/** + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags. + */ +public class ProxyResourceInner extends Resource { +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCreateParametersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCreateParametersInner.java index 83cdf386f63..b396067be52 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCreateParametersInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCreateParametersInner.java @@ -9,16 +9,17 @@ package com.microsoft.azure.management.redis.implementation; import java.util.Map; +import com.microsoft.azure.management.redis.TlsVersion; import com.microsoft.azure.management.redis.Sku; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.Resource; /** * Parameters supplied to the Create Redis operation. */ @JsonFlatten -public class RedisCreateParametersInner extends Resource { +public class RedisCreateParametersInner { /** * All Redis Settings. Few possible keys: * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value @@ -34,7 +35,7 @@ public class RedisCreateParametersInner extends Resource { private Boolean enableNonSslPort; /** - * tenantSettings. + * A dictionary of tenant settings. */ @JsonProperty(value = "properties.tenantSettings") private Map tenantSettings; @@ -45,6 +46,20 @@ public class RedisCreateParametersInner extends Resource { @JsonProperty(value = "properties.shardCount") private Integer shardCount; + /** + * Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', + * '1.1', '1.2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /** + * The SKU of the Redis cache to deploy. + */ + @JsonProperty(value = "properties.sku", required = true) + private Sku sku; + /** * The full resource ID of a subnet in a virtual network to deploy the * Redis cache in. Example format: @@ -61,10 +76,23 @@ public class RedisCreateParametersInner extends Resource { private String staticIP; /** - * The SKU of the Redis cache to deploy. + * A list of availability zones denoting where the resource needs to come + * from. */ - @JsonProperty(value = "properties.sku", required = true) - private Sku sku; + @JsonProperty(value = "zones") + private List zones; + + /** + * The geo-location where the resource lives. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; /** * Get the redisConfiguration value. @@ -146,6 +174,46 @@ public RedisCreateParametersInner withShardCount(Integer shardCount) { return this; } + /** + * Get the minimumTlsVersion value. + * + * @return the minimumTlsVersion value + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion value. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the RedisCreateParametersInner object itself. + */ + public RedisCreateParametersInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the RedisCreateParametersInner object itself. + */ + public RedisCreateParametersInner withSku(Sku sku) { + this.sku = sku; + return this; + } + /** * Get the subnetId value. * @@ -187,22 +255,62 @@ public RedisCreateParametersInner withStaticIP(String staticIP) { } /** - * Get the sku value. + * Get the zones value. * - * @return the sku value + * @return the zones value */ - public Sku sku() { - return this.sku; + public List zones() { + return this.zones; } /** - * Set the sku value. + * Set the zones value. * - * @param sku the sku value to set + * @param zones the zones value to set * @return the RedisCreateParametersInner object itself. */ - public RedisCreateParametersInner withSku(Sku sku) { - this.sku = sku; + public RedisCreateParametersInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the RedisCreateParametersInner object itself. + */ + public RedisCreateParametersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the RedisCreateParametersInner object itself. + */ + public RedisCreateParametersInner withTags(Map tags) { + this.tags = tags; return this; } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleCreateParametersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleCreateParametersInner.java new file mode 100644 index 00000000000..35af491c2f6 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleCreateParametersInner.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.redis.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters required for creating a firewall rule on redis cache. + */ +@JsonFlatten +public class RedisFirewallRuleCreateParametersInner { + /** + * lowest IP address included in the range. + */ + @JsonProperty(value = "properties.startIP", required = true) + private String startIP; + + /** + * highest IP address included in the range. + */ + @JsonProperty(value = "properties.endIP", required = true) + private String endIP; + + /** + * Get the startIP value. + * + * @return the startIP value + */ + public String startIP() { + return this.startIP; + } + + /** + * Set the startIP value. + * + * @param startIP the startIP value to set + * @return the RedisFirewallRuleCreateParametersInner object itself. + */ + public RedisFirewallRuleCreateParametersInner withStartIP(String startIP) { + this.startIP = startIP; + return this; + } + + /** + * Get the endIP value. + * + * @return the endIP value + */ + public String endIP() { + return this.endIP; + } + + /** + * Set the endIP value. + * + * @param endIP the endIP value to set + * @return the RedisFirewallRuleCreateParametersInner object itself. + */ + public RedisFirewallRuleCreateParametersInner withEndIP(String endIP) { + this.endIP = endIP; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleInner.java new file mode 100644 index 00000000000..6073862c57c --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisFirewallRuleInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A firewall rule on a redis cache has a name, and describes a contiguous + * range of IP addresses permitted to connect. + */ +@JsonFlatten +public class RedisFirewallRuleInner extends ProxyResourceInner { + /** + * lowest IP address included in the range. + */ + @JsonProperty(value = "properties.startIP", required = true) + private String startIP; + + /** + * highest IP address included in the range. + */ + @JsonProperty(value = "properties.endIP", required = true) + private String endIP; + + /** + * Get the startIP value. + * + * @return the startIP value + */ + public String startIP() { + return this.startIP; + } + + /** + * Set the startIP value. + * + * @param startIP the startIP value to set + * @return the RedisFirewallRuleInner object itself. + */ + public RedisFirewallRuleInner withStartIP(String startIP) { + this.startIP = startIP; + return this; + } + + /** + * Get the endIP value. + * + * @return the endIP value + */ + public String endIP() { + return this.endIP; + } + + /** + * Set the endIP value. + * + * @param endIP the endIP value to set + * @return the RedisFirewallRuleInner object itself. + */ + public RedisFirewallRuleInner withEndIP(String endIP) { + this.endIP = endIP; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisForceRebootResponseInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisForceRebootResponseInner.java index 7e3b8c90342..1b8500d9dad 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisForceRebootResponseInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisForceRebootResponseInner.java @@ -17,7 +17,7 @@ public class RedisForceRebootResponseInner { /** * Status message. */ - @JsonProperty(value = "Message", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java index d5a3b16fd87..ddb78af9e89 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java @@ -68,6 +68,14 @@ public RedisInner(Retrofit retrofit, RedisManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface RedisService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.redis.Redis checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Cache/CheckNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckNameAvailabilityParametersInner 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.redis.Redis listUpgradeNotifications" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listUpgradeNotifications") + Observable> listUpgradeNotifications(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("history") double history, @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.redis.Redis create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}") Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body RedisCreateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -93,11 +101,11 @@ interface RedisService { Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.redis.Redis listByResourceGroup" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis") 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.redis.Redis list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis") 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.redis.Redis listKeys" }) @@ -138,6 +146,175 @@ interface RedisService { } + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * @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 checkNameAvailability(CheckNameAvailabilityParametersInner parameters) { + checkNameAvailabilityWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * @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 checkNameAvailabilityAsync(CheckNameAvailabilityParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable checkNameAvailabilityAsync(CheckNameAvailabilityParametersInner parameters) { + return checkNameAvailabilityWithServiceResponseAsync(parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(CheckNameAvailabilityParametersInner parameters) { + 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.checkNameAvailability(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 = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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 any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param history how many minutes in past to look for upgrade notifications + * @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 NotificationListResponseInner object if successful. + */ + public NotificationListResponseInner listUpgradeNotifications(String resourceGroupName, String name, double history) { + return listUpgradeNotificationsWithServiceResponseAsync(resourceGroupName, name, history).toBlocking().single().body(); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param history how many minutes in past to look for upgrade notifications + * @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 listUpgradeNotificationsAsync(String resourceGroupName, String name, double history, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUpgradeNotificationsWithServiceResponseAsync(resourceGroupName, name, history), serviceCallback); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param history how many minutes in past to look for upgrade notifications + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationListResponseInner object + */ + public Observable listUpgradeNotificationsAsync(String resourceGroupName, String name, double history) { + return listUpgradeNotificationsWithServiceResponseAsync(resourceGroupName, name, history).map(new Func1, NotificationListResponseInner>() { + @Override + public NotificationListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param history how many minutes in past to look for upgrade notifications + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotificationListResponseInner object + */ + public Observable> listUpgradeNotificationsWithServiceResponseAsync(String resourceGroupName, String name, double history) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name 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.listUpgradeNotifications(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), history, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUpgradeNotificationsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUpgradeNotificationsDelegate(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 replace (overwrite/recreate, with potential downtime) an existing Redis cache. * @@ -304,8 +481,8 @@ public Observable> call(Response beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -553,6 +730,7 @@ public Observable> call(Response response) { private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); @@ -1305,8 +1483,8 @@ public Observable> call(Response response) { private ServiceResponse beginImportDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(202, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); @@ -1476,8 +1654,8 @@ public Observable> call(Response response) { private ServiceResponse beginExportDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(202, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerCreateParametersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerCreateParametersInner.java new file mode 100644 index 00000000000..c8d8f2c1049 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerCreateParametersInner.java @@ -0,0 +1,99 @@ +/** + * 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.redis.implementation; + +import com.microsoft.azure.management.redis.ReplicationRole; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameter required for creating a linked server to redis cache. + */ +@JsonFlatten +public class RedisLinkedServerCreateParametersInner { + /** + * Fully qualified resourceId of the linked redis cache. + */ + @JsonProperty(value = "properties.linkedRedisCacheId", required = true) + private String linkedRedisCacheId; + + /** + * Location of the linked redis cache. + */ + @JsonProperty(value = "properties.linkedRedisCacheLocation", required = true) + private String linkedRedisCacheLocation; + + /** + * Role of the linked server. Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "properties.serverRole", required = true) + private ReplicationRole serverRole; + + /** + * Get the linkedRedisCacheId value. + * + * @return the linkedRedisCacheId value + */ + public String linkedRedisCacheId() { + return this.linkedRedisCacheId; + } + + /** + * Set the linkedRedisCacheId value. + * + * @param linkedRedisCacheId the linkedRedisCacheId value to set + * @return the RedisLinkedServerCreateParametersInner object itself. + */ + public RedisLinkedServerCreateParametersInner withLinkedRedisCacheId(String linkedRedisCacheId) { + this.linkedRedisCacheId = linkedRedisCacheId; + return this; + } + + /** + * Get the linkedRedisCacheLocation value. + * + * @return the linkedRedisCacheLocation value + */ + public String linkedRedisCacheLocation() { + return this.linkedRedisCacheLocation; + } + + /** + * Set the linkedRedisCacheLocation value. + * + * @param linkedRedisCacheLocation the linkedRedisCacheLocation value to set + * @return the RedisLinkedServerCreateParametersInner object itself. + */ + public RedisLinkedServerCreateParametersInner withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + this.linkedRedisCacheLocation = linkedRedisCacheLocation; + return this; + } + + /** + * Get the serverRole value. + * + * @return the serverRole value + */ + public ReplicationRole serverRole() { + return this.serverRole; + } + + /** + * Set the serverRole value. + * + * @param serverRole the serverRole value to set + * @return the RedisLinkedServerCreateParametersInner object itself. + */ + public RedisLinkedServerCreateParametersInner withServerRole(ReplicationRole serverRole) { + this.serverRole = serverRole; + return this; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerWithPropertiesInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerWithPropertiesInner.java new file mode 100644 index 00000000000..140970cf60f --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisLinkedServerWithPropertiesInner.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.redis.implementation; + +import com.microsoft.azure.management.redis.ReplicationRole; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Response to put/get linked server (with properties) for Redis cache. + */ +@JsonFlatten +public class RedisLinkedServerWithPropertiesInner extends ProxyResourceInner { + /** + * Fully qualified resourceId of the linked redis cache. + */ + @JsonProperty(value = "properties.linkedRedisCacheId", required = true) + private String linkedRedisCacheId; + + /** + * Location of the linked redis cache. + */ + @JsonProperty(value = "properties.linkedRedisCacheLocation", required = true) + private String linkedRedisCacheLocation; + + /** + * Role of the linked server. Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "properties.serverRole", required = true) + private ReplicationRole serverRole; + + /** + * Terminal state of the link between primary and secondary redis cache. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the linkedRedisCacheId value. + * + * @return the linkedRedisCacheId value + */ + public String linkedRedisCacheId() { + return this.linkedRedisCacheId; + } + + /** + * Set the linkedRedisCacheId value. + * + * @param linkedRedisCacheId the linkedRedisCacheId value to set + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withLinkedRedisCacheId(String linkedRedisCacheId) { + this.linkedRedisCacheId = linkedRedisCacheId; + return this; + } + + /** + * Get the linkedRedisCacheLocation value. + * + * @return the linkedRedisCacheLocation value + */ + public String linkedRedisCacheLocation() { + return this.linkedRedisCacheLocation; + } + + /** + * Set the linkedRedisCacheLocation value. + * + * @param linkedRedisCacheLocation the linkedRedisCacheLocation value to set + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + this.linkedRedisCacheLocation = linkedRedisCacheLocation; + return this; + } + + /** + * Get the serverRole value. + * + * @return the serverRole value + */ + public ReplicationRole serverRole() { + return this.serverRole; + } + + /** + * Set the serverRole value. + * + * @param serverRole the serverRole value to set + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withServerRole(ReplicationRole serverRole) { + this.serverRole = serverRole; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisManagementClientImpl.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisManagementClientImpl.java index c15ca61aec8..fad5523ead4 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisManagementClientImpl.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisManagementClientImpl.java @@ -132,6 +132,19 @@ public RedisManagementClientImpl withGenerateClientRequestId(boolean generateCli return this; } + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + /** * The RedisInner object to access its operations. */ @@ -145,6 +158,19 @@ public RedisInner redis() { return this.redis; } + /** + * The FirewallRulesInner object to access its operations. + */ + private FirewallRulesInner firewallRules; + + /** + * Gets the FirewallRulesInner object to access its operations. + * @return the FirewallRulesInner object. + */ + public FirewallRulesInner firewallRules() { + return this.firewallRules; + } + /** * The PatchSchedulesInner object to access its operations. */ @@ -158,6 +184,19 @@ public PatchSchedulesInner patchSchedules() { return this.patchSchedules; } + /** + * The LinkedServersInner object to access its operations. + */ + private LinkedServersInner linkedServers; + + /** + * Gets the LinkedServersInner object to access its operations. + * @return the LinkedServersInner object. + */ + public LinkedServersInner linkedServers() { + return this.linkedServers; + } + /** * Initializes an instance of RedisManagementClient client. * @@ -189,12 +228,15 @@ public RedisManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2016-04-01"; + this.apiVersion = "2018-03-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); this.redis = new RedisInner(restClient().retrofit(), this); + this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); this.patchSchedules = new PatchSchedulesInner(restClient().retrofit(), this); + this.linkedServers = new LinkedServersInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -205,6 +247,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "RedisManagementClient", "2016-04-01"); + return String.format("%s (%s, %s)", super.userAgent(), "RedisManagementClient", "2018-03-01"); } } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisPatchScheduleInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisPatchScheduleInner.java index 45716c4cb48..2c555e03a53 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisPatchScheduleInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisPatchScheduleInner.java @@ -16,73 +16,13 @@ * Response to put/get patch schedules for Redis cache. */ @JsonFlatten -public class RedisPatchScheduleInner { - /** - * Resource ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Resource name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Resource location. - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - +public class RedisPatchScheduleInner extends ProxyResourceInner { /** * List of patch schedules for a Redis cache. */ @JsonProperty(value = "properties.scheduleEntries", required = true) private List scheduleEntries; - /** - * Get the id value. - * - * @return the id value - */ - public String id() { - return this.id; - } - - /** - * Get the name value. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Get the type value. - * - * @return the type value - */ - public String type() { - return this.type; - } - - /** - * Get the location value. - * - * @return the location value - */ - public String location() { - return this.location; - } - /** * Get the scheduleEntries value. * diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisResourceInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisResourceInner.java index 5c67cdf1b6b..c2d55a50091 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisResourceInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisResourceInner.java @@ -9,16 +9,19 @@ package com.microsoft.azure.management.redis.implementation; import java.util.Map; +import com.microsoft.azure.management.redis.TlsVersion; import com.microsoft.azure.management.redis.Sku; +import com.microsoft.azure.management.redis.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.redis.RedisLinkedServer; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.Resource; /** * A single Redis item in List or Get Operation. */ @JsonFlatten -public class RedisResourceInner extends Resource { +public class RedisResourceInner extends TrackedResourceInner { /** * All Redis Settings. Few possible keys: * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value @@ -34,7 +37,7 @@ public class RedisResourceInner extends Resource { private Boolean enableNonSslPort; /** - * tenantSettings. + * A dictionary of tenant settings. */ @JsonProperty(value = "properties.tenantSettings") private Map tenantSettings; @@ -45,6 +48,20 @@ public class RedisResourceInner extends Resource { @JsonProperty(value = "properties.shardCount") private Integer shardCount; + /** + * Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', + * '1.1', '1.2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /** + * The SKU of the Redis cache to deploy. + */ + @JsonProperty(value = "properties.sku", required = true) + private Sku sku; + /** * The full resource ID of a subnet in a virtual network to deploy the * Redis cache in. Example format: @@ -60,12 +77,6 @@ public class RedisResourceInner extends Resource { @JsonProperty(value = "properties.staticIP") private String staticIP; - /** - * The SKU of the Redis cache to deploy. - */ - @JsonProperty(value = "properties.sku") - private Sku sku; - /** * Redis version. */ @@ -73,10 +84,13 @@ public class RedisResourceInner extends Resource { private String redisVersion; /** - * Redis instance provisioning status. + * Redis instance provisioning status. Possible values include: 'Creating', + * 'Deleting', 'Disabled', 'Failed', 'Linking', 'Provisioning', + * 'RecoveringScaleFailure', 'Scaling', 'Succeeded', 'Unlinking', + * 'Unprovisioning', 'Updating'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; /** * Redis host name. @@ -103,6 +117,19 @@ public class RedisResourceInner extends Resource { @JsonProperty(value = "properties.accessKeys", access = JsonProperty.Access.WRITE_ONLY) private RedisAccessKeysInner accessKeys; + /** + * List of the linked servers associated with the cache. + */ + @JsonProperty(value = "properties.linkedServers", access = JsonProperty.Access.WRITE_ONLY) + private List linkedServers; + + /** + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + /** * Get the redisConfiguration value. * @@ -183,6 +210,46 @@ public RedisResourceInner withShardCount(Integer shardCount) { return this; } + /** + * Get the minimumTlsVersion value. + * + * @return the minimumTlsVersion value + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion value. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + /** * Get the subnetId value. * @@ -223,26 +290,6 @@ public RedisResourceInner withStaticIP(String staticIP) { return this; } - /** - * Get the sku value. - * - * @return the sku value - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku value. - * - * @param sku the sku value to set - * @return the RedisResourceInner object itself. - */ - public RedisResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - /** * Get the redisVersion value. * @@ -257,7 +304,7 @@ public String redisVersion() { * * @return the provisioningState value */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } @@ -297,4 +344,33 @@ public RedisAccessKeysInner accessKeys() { return this.accessKeys; } + /** + * Get the linkedServers value. + * + * @return the linkedServers value + */ + public List linkedServers() { + return this.linkedServers; + } + + /** + * Get the zones value. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones value. + * + * @param zones the zones value to set + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withZones(List zones) { + this.zones = zones; + return this; + } + } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisUpdateParametersInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisUpdateParametersInner.java index ad5da9a325c..cd0517bd597 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisUpdateParametersInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisUpdateParametersInner.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.redis.implementation; import java.util.Map; +import com.microsoft.azure.management.redis.TlsVersion; import com.microsoft.azure.management.redis.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -33,7 +34,7 @@ public class RedisUpdateParametersInner { private Boolean enableNonSslPort; /** - * tenantSettings. + * A dictionary of tenant settings. */ @JsonProperty(value = "properties.tenantSettings") private Map tenantSettings; @@ -45,19 +46,12 @@ public class RedisUpdateParametersInner { private Integer shardCount; /** - * The full resource ID of a subnet in a virtual network to deploy the - * Redis cache in. Example format: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). Possible values include: '1.0', + * '1.1', '1.2'. */ - @JsonProperty(value = "properties.subnetId") - private String subnetId; - - /** - * Static IP address. Required when deploying a Redis cache inside an - * existing Azure Virtual Network. - */ - @JsonProperty(value = "properties.staticIP") - private String staticIP; + @JsonProperty(value = "properties.minimumTlsVersion") + private TlsVersion minimumTlsVersion; /** * The SKU of the Redis cache to deploy. @@ -68,7 +62,7 @@ public class RedisUpdateParametersInner { /** * Resource tags. */ - @JsonProperty(value = "properties.tags") + @JsonProperty(value = "tags") private Map tags; /** @@ -152,42 +146,22 @@ public RedisUpdateParametersInner withShardCount(Integer shardCount) { } /** - * Get the subnetId value. - * - * @return the subnetId value - */ - public String subnetId() { - return this.subnetId; - } - - /** - * Set the subnetId value. - * - * @param subnetId the subnetId value to set - * @return the RedisUpdateParametersInner object itself. - */ - public RedisUpdateParametersInner withSubnetId(String subnetId) { - this.subnetId = subnetId; - return this; - } - - /** - * Get the staticIP value. + * Get the minimumTlsVersion value. * - * @return the staticIP value + * @return the minimumTlsVersion value */ - public String staticIP() { - return this.staticIP; + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; } /** - * Set the staticIP value. + * Set the minimumTlsVersion value. * - * @param staticIP the staticIP value to set + * @param minimumTlsVersion the minimumTlsVersion value to set * @return the RedisUpdateParametersInner object itself. */ - public RedisUpdateParametersInner withStaticIP(String staticIP) { - this.staticIP = staticIP; + public RedisUpdateParametersInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; return this; } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/TrackedResourceInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/TrackedResourceInner.java new file mode 100644 index 00000000000..82809e00ae0 --- /dev/null +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/TrackedResourceInner.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.redis.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The resource model definition for a ARM tracked top level resource. + */ +public class TrackedResourceInner extends Resource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The geo-location where the resource lives. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + +}