diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CheckNameAvailabilityParameters.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CheckNameAvailabilityParameters.java new file mode 100644 index 00000000000..c8e00f36a0a --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CheckNameAvailabilityParameters.java @@ -0,0 +1,78 @@ +/** + * 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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for a check name availability request. + */ +public class CheckNameAvailabilityParameters { + /** + * The name to check for availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type. Must be set to + * Microsoft.StorageSync/storageSyncServices. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the name to check for availability. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.StorageSync/storageSyncServices"; + } + + /** + * Get the name to check for availability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name to check for availability. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreheartbeatHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreheartbeatHeaders.java new file mode 100644 index 00000000000..ef8ca834a81 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreheartbeatHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for restoreheartbeat operation. + */ +public class CloudEndpointsRestoreheartbeatHeaders { + /** + * request id. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /** + * correlation request id. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get request id. + * + * @return the xMsRequestId value + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set request id. + * + * @param xMsRequestId the xMsRequestId value to set + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get correlation request id. + * + * @return the xMsCorrelationRequestId value + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set correlation request id. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/NameAvailabilityReason.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/NameAvailabilityReason.java new file mode 100644 index 00000000000..ef05cfba23a --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/NameAvailabilityReason.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NameAvailabilityReason. + */ +public enum NameAvailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a NameAvailabilityReason instance. */ + private String value; + + NameAvailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameAvailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameAvailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String value) { + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallActionHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallActionHeaders.java new file mode 100644 index 00000000000..988d30e021b --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallActionHeaders.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for recallAction operation. + */ +public class ServerEndpointsRecallActionHeaders { + /** + * request id. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /** + * correlation request id. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get request id. + * + * @return the xMsRequestId value + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set request id. + * + * @param xMsRequestId the xMsRequestId value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get correlation request id. + * + * @return the xMsCorrelationRequestId value + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set correlation request id. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set operation Status Location URI. + * + * @param location the location value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CheckNameAvailabilityResultInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 00000000000..2b7e47e3511 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * 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.storagesync.implementation; + +import com.microsoft.azure.management.storagesync.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a Storage Sync Service name could not be used. The + * Reason element is only returned if NameAvailable is false. Possible + * values include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private NameAvailabilityReason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointInner.java index 58959d5cc17..2b785dddcdc 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointInner.java @@ -77,6 +77,12 @@ public class CloudEndpointInner extends ProxyResource { @JsonProperty(value = "properties.lastWorkflowId") private String lastWorkflowId; + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + /** * Get storage Account access key. * @@ -266,4 +272,24 @@ public CloudEndpointInner withLastWorkflowId(String lastWorkflowId) { return this; } + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + } diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsInner.java index 9af6973fdaa..02f2cf07e77 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsInner.java @@ -19,7 +19,7 @@ import com.microsoft.azure.management.storagesync.CloudEndpointsPostRestoreHeaders; import com.microsoft.azure.management.storagesync.CloudEndpointsPreBackupHeaders; import com.microsoft.azure.management.storagesync.CloudEndpointsPreRestoreHeaders; -import com.microsoft.azure.management.storagesync.CloudEndpointsRestoreHeatbeatHeaders; +import com.microsoft.azure.management.storagesync.CloudEndpointsRestoreheartbeatHeaders; import com.microsoft.azure.management.storagesync.PostRestoreRequest; import com.microsoft.azure.management.storagesync.PreRestoreRequest; import com.microsoft.azure.management.storagesync.StorageSyncErrorException; @@ -117,9 +117,9 @@ interface CloudEndpointsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore") Observable> beginPreRestore(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("cloudEndpointName") String cloudEndpointName, @Query("api-version") String apiVersion, @Body PreRestoreRequest parameters, @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.storagesync.CloudEndpoints restoreHeatbeat" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints restoreheartbeat" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat") - Observable> restoreHeatbeat(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("cloudEndpointName") String cloudEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> restoreheartbeat(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("cloudEndpointName") String cloudEndpointName, @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.storagesync.CloudEndpoints postRestore" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore") @@ -1671,8 +1671,8 @@ private ServiceResponseWithHeaders beginP * @throws StorageSyncErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void restoreHeatbeat(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { - restoreHeatbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + public void restoreheartbeat(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); } /** @@ -1686,8 +1686,8 @@ public void restoreHeatbeat(String resourceGroupName, String storageSyncServiceN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture restoreHeatbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromHeaderResponse(restoreHeatbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + public ServiceFuture restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); } /** @@ -1700,10 +1700,10 @@ public ServiceFuture restoreHeatbeatAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable restoreHeatbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { - return restoreHeatbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + public Observable restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { @Override - public Void call(ServiceResponseWithHeaders response) { + public Void call(ServiceResponseWithHeaders response) { return response.body(); } }); @@ -1719,7 +1719,7 @@ public Void call(ServiceResponseWithHeaders> restoreHeatbeatWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + public Observable> restoreheartbeatWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1738,12 +1738,12 @@ public Observable, Observable>>() { + return service.restoreheartbeat(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponseWithHeaders clientResponse = restoreHeatbeatDelegate(response); + ServiceResponseWithHeaders clientResponse = restoreheartbeatDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1752,11 +1752,11 @@ public Observable restoreHeatbeatDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + private ServiceResponseWithHeaders restoreheartbeatDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(StorageSyncErrorException.class) - .buildWithHeaders(response, CloudEndpointsRestoreHeatbeatHeaders.class); + .buildWithHeaders(response, CloudEndpointsRestoreheartbeatHeaders.class); } /** diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServerInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServerInner.java index 2bb1367fb1e..6991942d056 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServerInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServerInner.java @@ -106,6 +106,30 @@ public class RegisteredServerInner { @JsonProperty(value = "properties.lastWorkflowId") private String lastWorkflowId; + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /** + * Resource discoveryEndpointUri. + */ + @JsonProperty(value = "properties.discoveryEndpointUri") + private String discoveryEndpointUri; + + /** + * Resource Location. + */ + @JsonProperty(value = "properties.resourceLocation") + private String resourceLocation; + + /** + * Service Location. + */ + @JsonProperty(value = "properties.serviceLocation") + private String serviceLocation; + /** * Get resource Id. * @@ -373,4 +397,84 @@ public RegisteredServerInner withLastWorkflowId(String lastWorkflowId) { return this; } + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + + /** + * Get resource discoveryEndpointUri. + * + * @return the discoveryEndpointUri value + */ + public String discoveryEndpointUri() { + return this.discoveryEndpointUri; + } + + /** + * Set resource discoveryEndpointUri. + * + * @param discoveryEndpointUri the discoveryEndpointUri value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withDiscoveryEndpointUri(String discoveryEndpointUri) { + this.discoveryEndpointUri = discoveryEndpointUri; + return this; + } + + /** + * Get resource Location. + * + * @return the resourceLocation value + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Set resource Location. + * + * @param resourceLocation the resourceLocation value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withResourceLocation(String resourceLocation) { + this.resourceLocation = resourceLocation; + return this; + } + + /** + * Get service Location. + * + * @return the serviceLocation value + */ + public String serviceLocation() { + return this.serviceLocation; + } + + /** + * Set service Location. + * + * @param serviceLocation the serviceLocation value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServiceLocation(String serviceLocation) { + this.serviceLocation = serviceLocation; + return this; + } + } diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointInner.java index 700e53203f0..cc18f950e31 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointInner.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.storagesync.implementation; -import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.ProxyResource; @@ -42,86 +41,6 @@ public class ServerEndpointInner extends ProxyResource { @JsonProperty(value = "properties.friendlyName") private String friendlyName; - /** - * Last Sync Success. - */ - @JsonProperty(value = "properties.lastSyncSuccess") - private DateTime lastSyncSuccess; - - /** - * Sync Error State. - */ - @JsonProperty(value = "properties.syncErrorState") - private String syncErrorState; - - /** - * Sync Error State Timestamp. - */ - @JsonProperty(value = "properties.syncErrorStateTimestamp") - private DateTime syncErrorStateTimestamp; - - /** - * Sync Error Direction. Possible values include: 'none', 'initialize', - * 'download', 'upload', 'recall'. - */ - @JsonProperty(value = "properties.syncErrorDirection") - private String syncErrorDirection; - - /** - * Item Upload Error Count. - */ - @JsonProperty(value = "properties.itemUploadErrorCount") - private Integer itemUploadErrorCount; - - /** - * Item download error count. - */ - @JsonProperty(value = "properties.itemDownloadErrorCount") - private Integer itemDownloadErrorCount; - - /** - * sync error context. - */ - @JsonProperty(value = "properties.syncErrorContext") - private String syncErrorContext; - - /** - * current progress type. Possible values include: 'none', 'initialize', - * 'download', 'upload', 'recall'. - */ - @JsonProperty(value = "properties.currentProgressType") - private String currentProgressType; - - /** - * Item Progress Count. - */ - @JsonProperty(value = "properties.itemProgressCount") - private Integer itemProgressCount; - - /** - * Item Total Count. - */ - @JsonProperty(value = "properties.itemTotalCount") - private Integer itemTotalCount; - - /** - * Bytes in progress. - */ - @JsonProperty(value = "properties.byteProgress") - private Integer byteProgress; - - /** - * Total progress. - */ - @JsonProperty(value = "properties.totalProgress") - private Integer totalProgress; - - /** - * Bytes total. - */ - @JsonProperty(value = "properties.byteTotal") - private Integer byteTotal; - /** * Server Resource Id. */ @@ -140,6 +59,18 @@ public class ServerEndpointInner extends ProxyResource { @JsonProperty(value = "properties.lastWorkflowId") private String lastWorkflowId; + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /** + * Sync Health Status. + */ + @JsonProperty(value = "properties.syncStatus") + private String syncStatus; + /** * Get server Local path. * @@ -220,266 +151,6 @@ public ServerEndpointInner withFriendlyName(String friendlyName) { return this; } - /** - * Get last Sync Success. - * - * @return the lastSyncSuccess value - */ - public DateTime lastSyncSuccess() { - return this.lastSyncSuccess; - } - - /** - * Set last Sync Success. - * - * @param lastSyncSuccess the lastSyncSuccess value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withLastSyncSuccess(DateTime lastSyncSuccess) { - this.lastSyncSuccess = lastSyncSuccess; - return this; - } - - /** - * Get sync Error State. - * - * @return the syncErrorState value - */ - public String syncErrorState() { - return this.syncErrorState; - } - - /** - * Set sync Error State. - * - * @param syncErrorState the syncErrorState value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withSyncErrorState(String syncErrorState) { - this.syncErrorState = syncErrorState; - return this; - } - - /** - * Get sync Error State Timestamp. - * - * @return the syncErrorStateTimestamp value - */ - public DateTime syncErrorStateTimestamp() { - return this.syncErrorStateTimestamp; - } - - /** - * Set sync Error State Timestamp. - * - * @param syncErrorStateTimestamp the syncErrorStateTimestamp value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withSyncErrorStateTimestamp(DateTime syncErrorStateTimestamp) { - this.syncErrorStateTimestamp = syncErrorStateTimestamp; - return this; - } - - /** - * Get sync Error Direction. Possible values include: 'none', 'initialize', 'download', 'upload', 'recall'. - * - * @return the syncErrorDirection value - */ - public String syncErrorDirection() { - return this.syncErrorDirection; - } - - /** - * Set sync Error Direction. Possible values include: 'none', 'initialize', 'download', 'upload', 'recall'. - * - * @param syncErrorDirection the syncErrorDirection value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withSyncErrorDirection(String syncErrorDirection) { - this.syncErrorDirection = syncErrorDirection; - return this; - } - - /** - * Get item Upload Error Count. - * - * @return the itemUploadErrorCount value - */ - public Integer itemUploadErrorCount() { - return this.itemUploadErrorCount; - } - - /** - * Set item Upload Error Count. - * - * @param itemUploadErrorCount the itemUploadErrorCount value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withItemUploadErrorCount(Integer itemUploadErrorCount) { - this.itemUploadErrorCount = itemUploadErrorCount; - return this; - } - - /** - * Get item download error count. - * - * @return the itemDownloadErrorCount value - */ - public Integer itemDownloadErrorCount() { - return this.itemDownloadErrorCount; - } - - /** - * Set item download error count. - * - * @param itemDownloadErrorCount the itemDownloadErrorCount value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withItemDownloadErrorCount(Integer itemDownloadErrorCount) { - this.itemDownloadErrorCount = itemDownloadErrorCount; - return this; - } - - /** - * Get sync error context. - * - * @return the syncErrorContext value - */ - public String syncErrorContext() { - return this.syncErrorContext; - } - - /** - * Set sync error context. - * - * @param syncErrorContext the syncErrorContext value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withSyncErrorContext(String syncErrorContext) { - this.syncErrorContext = syncErrorContext; - return this; - } - - /** - * Get current progress type. Possible values include: 'none', 'initialize', 'download', 'upload', 'recall'. - * - * @return the currentProgressType value - */ - public String currentProgressType() { - return this.currentProgressType; - } - - /** - * Set current progress type. Possible values include: 'none', 'initialize', 'download', 'upload', 'recall'. - * - * @param currentProgressType the currentProgressType value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withCurrentProgressType(String currentProgressType) { - this.currentProgressType = currentProgressType; - return this; - } - - /** - * Get item Progress Count. - * - * @return the itemProgressCount value - */ - public Integer itemProgressCount() { - return this.itemProgressCount; - } - - /** - * Set item Progress Count. - * - * @param itemProgressCount the itemProgressCount value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withItemProgressCount(Integer itemProgressCount) { - this.itemProgressCount = itemProgressCount; - return this; - } - - /** - * Get item Total Count. - * - * @return the itemTotalCount value - */ - public Integer itemTotalCount() { - return this.itemTotalCount; - } - - /** - * Set item Total Count. - * - * @param itemTotalCount the itemTotalCount value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withItemTotalCount(Integer itemTotalCount) { - this.itemTotalCount = itemTotalCount; - return this; - } - - /** - * Get bytes in progress. - * - * @return the byteProgress value - */ - public Integer byteProgress() { - return this.byteProgress; - } - - /** - * Set bytes in progress. - * - * @param byteProgress the byteProgress value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withByteProgress(Integer byteProgress) { - this.byteProgress = byteProgress; - return this; - } - - /** - * Get total progress. - * - * @return the totalProgress value - */ - public Integer totalProgress() { - return this.totalProgress; - } - - /** - * Set total progress. - * - * @param totalProgress the totalProgress value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withTotalProgress(Integer totalProgress) { - this.totalProgress = totalProgress; - return this; - } - - /** - * Get bytes total. - * - * @return the byteTotal value - */ - public Integer byteTotal() { - return this.byteTotal; - } - - /** - * Set bytes total. - * - * @param byteTotal the byteTotal value to set - * @return the ServerEndpointInner object itself. - */ - public ServerEndpointInner withByteTotal(Integer byteTotal) { - this.byteTotal = byteTotal; - return this; - } - /** * Get server Resource Id. * @@ -540,4 +211,44 @@ public ServerEndpointInner withLastWorkflowId(String lastWorkflowId) { return this; } + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + + /** + * Get sync Health Status. + * + * @return the syncStatus value + */ + public String syncStatus() { + return this.syncStatus; + } + + /** + * Set sync Health Status. + * + * @param syncStatus the syncStatus value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withSyncStatus(String syncStatus) { + this.syncStatus = syncStatus; + return this; + } + } diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsInner.java index ebc7ed44694..51c05365cb3 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsInner.java @@ -14,7 +14,7 @@ import com.microsoft.azure.management.storagesync.ServerEndpointsDeleteHeaders; import com.microsoft.azure.management.storagesync.ServerEndpointsGetHeaders; import com.microsoft.azure.management.storagesync.ServerEndpointsListBySyncGroupHeaders; -import com.microsoft.azure.management.storagesync.ServerEndpointsRecallHeaders; +import com.microsoft.azure.management.storagesync.ServerEndpointsRecallActionHeaders; import com.microsoft.azure.management.storagesync.ServerEndpointsUpdateHeaders; import com.microsoft.azure.management.storagesync.StorageSyncErrorException; import com.microsoft.rest.ServiceCallback; @@ -96,13 +96,13 @@ interface ServerEndpointsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints") Observable> listBySyncGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @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.storagesync.ServerEndpoints recall" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpoints recallAction" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") - Observable> recall(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> recallAction(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @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.storagesync.ServerEndpoints beginRecall" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpoints beginRecallAction" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") - Observable> beginRecall(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginRecallAction(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -1068,8 +1068,8 @@ private ServiceResponseWithHeaders, ServerEndpoin * @throws StorageSyncErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void recall(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { - recallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().last().body(); + public void recallAction(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().last().body(); } /** @@ -1083,8 +1083,8 @@ public void recall(String resourceGroupName, String storageSyncServiceName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture recallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromHeaderResponse(recallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + public ServiceFuture recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); } /** @@ -1097,10 +1097,10 @@ public ServiceFuture recallAsync(String resourceGroupName, String storageS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable recallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { - return recallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + public Observable recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { @Override - public Void call(ServiceResponseWithHeaders response) { + public Void call(ServiceResponseWithHeaders response) { return response.body(); } }); @@ -1116,7 +1116,7 @@ public Void call(ServiceResponseWithHeaders * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> recallWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + public Observable> recallActionWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1135,8 +1135,8 @@ public Observable if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Observable> observable = service.recall(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsRecallHeaders.class); + Observable> observable = service.recallAction(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsRecallActionHeaders.class); } /** @@ -1150,8 +1150,8 @@ public Observable * @throws StorageSyncErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void beginRecall(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { - beginRecallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); + public void beginRecallAction(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); } /** @@ -1165,8 +1165,8 @@ public void beginRecall(String resourceGroupName, String storageSyncServiceName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRecallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromHeaderResponse(beginRecallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + public ServiceFuture beginRecallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); } /** @@ -1179,10 +1179,10 @@ public ServiceFuture beginRecallAsync(String resourceGroupName, String sto * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable beginRecallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { - return beginRecallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + public Observable beginRecallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { @Override - public Void call(ServiceResponseWithHeaders response) { + public Void call(ServiceResponseWithHeaders response) { return response.body(); } }); @@ -1198,7 +1198,7 @@ public Void call(ServiceResponseWithHeaders * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponseWithHeaders} object if successful. */ - public Observable> beginRecallWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + public Observable> beginRecallActionWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1217,12 +1217,12 @@ public Observable if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.beginRecall(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginRecallAction(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponseWithHeaders clientResponse = beginRecallDelegate(response); + ServiceResponseWithHeaders clientResponse = beginRecallActionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1231,12 +1231,12 @@ public Observable }); } - private ServiceResponseWithHeaders beginRecallDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + private ServiceResponseWithHeaders beginRecallActionDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(StorageSyncErrorException.class) - .buildWithHeaders(response, ServerEndpointsRecallHeaders.class); + .buildWithHeaders(response, ServerEndpointsRecallActionHeaders.class); } } diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncManagementClientImpl.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncManagementClientImpl.java index 1d0147f71d9..597c0797e21 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncManagementClientImpl.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncManagementClientImpl.java @@ -254,7 +254,7 @@ public StorageSyncManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2017-06-05-preview"; + this.apiVersion = "2018-04-02"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -275,6 +275,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "StorageSyncManagementClient", "2017-06-05-preview"); + return String.format("%s (%s, %s)", super.userAgent(), "StorageSyncManagementClient", "2018-04-02"); } } diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServicesInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServicesInner.java index c897122bcf2..4dde823eff7 100644 --- a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServicesInner.java +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServicesInner.java @@ -13,6 +13,8 @@ import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storagesync.CheckNameAvailabilityParameters; import com.microsoft.azure.management.storagesync.StorageSyncErrorException; import com.microsoft.azure.management.storagesync.StorageSyncServicesDeleteHeaders; import com.microsoft.azure.management.storagesync.StorageSyncServicesGetHeaders; @@ -36,6 +38,7 @@ import retrofit2.http.HTTP; import retrofit2.http.PATCH; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -68,6 +71,10 @@ public StorageSyncServicesInner(Retrofit retrofit, StorageSyncManagementClientIm * used by Retrofit to perform actually REST calls. */ interface StorageSyncServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServices checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameters parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServices create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}") Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Query("api-version") String apiVersion, @Body StorageSyncServiceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -94,6 +101,94 @@ interface StorageSyncServicesService { } + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @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 CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).toBlocking().single().body(); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @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(String locationName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, name), serviceCallback); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, String name) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName 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."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CheckNameAvailabilityParameters parameters = new CheckNameAvailabilityParameters(); + parameters.withName(name); + return service.checkNameAvailability(locationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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); + } + /** * Create a new StorageSyncService. *