diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/AbortWorkflowsPostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/AbortWorkflowsPostHeaders.java new file mode 100644 index 00000000000..7c3332c1bcc --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/AbortWorkflowsPostHeaders.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 Post operation. + */ +public class AbortWorkflowsPostHeaders { + /** + * 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 AbortWorkflowsPostHeaders object itself. + */ + public AbortWorkflowsPostHeaders 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 AbortWorkflowsPostHeaders object itself. + */ + public AbortWorkflowsPostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/BackupRequest.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/BackupRequest.java new file mode 100644 index 00000000000..8b70e0af1e3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/BackupRequest.java @@ -0,0 +1,43 @@ +/** + * 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; + +/** + * Backup request. + */ +public class BackupRequest { + /** + * Azure File Share. + */ + @JsonProperty(value = "azureFileShare") + private String azureFileShare; + + /** + * Get azure File Share. + * + * @return the azureFileShare value + */ + public String azureFileShare() { + return this.azureFileShare; + } + + /** + * Set azure File Share. + * + * @param azureFileShare the azureFileShare value to set + * @return the BackupRequest object itself. + */ + public BackupRequest withAzureFileShare(String azureFileShare) { + this.azureFileShare = azureFileShare; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostBackupPostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostBackupPostHeaders.java new file mode 100644 index 00000000000..3caaecea218 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostBackupPostHeaders.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 Post operation. + */ +public class CloudEndpointPostBackupPostHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointPostBackupPostHeaders object itself. + */ + public CloudEndpointPostBackupPostHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointPostBackupPostHeaders object itself. + */ + public CloudEndpointPostBackupPostHeaders 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 CloudEndpointPostBackupPostHeaders object itself. + */ + public CloudEndpointPostBackupPostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostRestorePostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostRestorePostHeaders.java new file mode 100644 index 00000000000..1896848cf36 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPostRestorePostHeaders.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 Post operation. + */ +public class CloudEndpointPostRestorePostHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointPostRestorePostHeaders object itself. + */ + public CloudEndpointPostRestorePostHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointPostRestorePostHeaders object itself. + */ + public CloudEndpointPostRestorePostHeaders 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 CloudEndpointPostRestorePostHeaders object itself. + */ + public CloudEndpointPostRestorePostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreBackupPostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreBackupPostHeaders.java new file mode 100644 index 00000000000..a720427ffe2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreBackupPostHeaders.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 Post operation. + */ +public class CloudEndpointPreBackupPostHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointPreBackupPostHeaders object itself. + */ + public CloudEndpointPreBackupPostHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointPreBackupPostHeaders object itself. + */ + public CloudEndpointPreBackupPostHeaders 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 CloudEndpointPreBackupPostHeaders object itself. + */ + public CloudEndpointPreBackupPostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreRestorePostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreRestorePostHeaders.java new file mode 100644 index 00000000000..2266db74b8a --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointPreRestorePostHeaders.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 Post operation. + */ +public class CloudEndpointPreRestorePostHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointPreRestorePostHeaders object itself. + */ + public CloudEndpointPreRestorePostHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointPreRestorePostHeaders object itself. + */ + public CloudEndpointPreRestorePostHeaders 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 CloudEndpointPreRestorePostHeaders object itself. + */ + public CloudEndpointPreRestorePostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointRestoreHeatbeatPostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointRestoreHeatbeatPostHeaders.java new file mode 100644 index 00000000000..79091158fdd --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointRestoreHeatbeatPostHeaders.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 Post operation. + */ +public class CloudEndpointRestoreHeatbeatPostHeaders { + /** + * 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 CloudEndpointRestoreHeatbeatPostHeaders object itself. + */ + public CloudEndpointRestoreHeatbeatPostHeaders 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 CloudEndpointRestoreHeatbeatPostHeaders object itself. + */ + public CloudEndpointRestoreHeatbeatPostHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsCreateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsCreateHeaders.java new file mode 100644 index 00000000000..2ca42b8d5b2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsCreateHeaders.java @@ -0,0 +1,147 @@ +/** + * 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 Create operation. + */ +public class CloudEndpointsCreateHeaders { + /** + * 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 = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Retry After. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * 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 CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders 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 CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set operation Status Location URI. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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 CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get retry After. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set retry After. + * + * @param retryAfter the retryAfter value to set + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsDeleteHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsDeleteHeaders.java new file mode 100644 index 00000000000..32a1851bfa2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsDeleteHeaders.java @@ -0,0 +1,147 @@ +/** + * 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 Delete operation. + */ +public class CloudEndpointsDeleteHeaders { + /** + * 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 = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Retry After. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * 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 CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders 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 CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set operation Status Location URI. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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 CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get retry After. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set retry After. + * + * @param retryAfter the retryAfter value to set + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetHeaders.java new file mode 100644 index 00000000000..c40d97a7af4 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetHeaders.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 Get operation. + */ +public class CloudEndpointsGetHeaders { + /** + * 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 CloudEndpointsGetHeaders object itself. + */ + public CloudEndpointsGetHeaders 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 CloudEndpointsGetHeaders object itself. + */ + public CloudEndpointsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetListBySyncGroupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetListBySyncGroupHeaders.java new file mode 100644 index 00000000000..a85ff4178d3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsGetListBySyncGroupHeaders.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 ListBySyncGroup operation. + */ +public class CloudEndpointsGetListBySyncGroupHeaders { + /** + * 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 CloudEndpointsGetListBySyncGroupHeaders object itself. + */ + public CloudEndpointsGetListBySyncGroupHeaders 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 CloudEndpointsGetListBySyncGroupHeaders object itself. + */ + public CloudEndpointsGetListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsListBySyncGroupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsListBySyncGroupHeaders.java new file mode 100644 index 00000000000..6fc1569155f --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsListBySyncGroupHeaders.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 ListBySyncGroup operation. + */ +public class CloudEndpointsListBySyncGroupHeaders { + /** + * 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 CloudEndpointsListBySyncGroupHeaders object itself. + */ + public CloudEndpointsListBySyncGroupHeaders 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 CloudEndpointsListBySyncGroupHeaders object itself. + */ + public CloudEndpointsListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostBackupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostBackupHeaders.java new file mode 100644 index 00000000000..2aa8839f35a --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostBackupHeaders.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 PostBackup operation. + */ +public class CloudEndpointsPostBackupHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders 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 CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostRestoreHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostRestoreHeaders.java new file mode 100644 index 00000000000..3b7883bc9c4 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPostRestoreHeaders.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 PostRestore operation. + */ +public class CloudEndpointsPostRestoreHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders 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 CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreBackupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreBackupHeaders.java new file mode 100644 index 00000000000..84796ad49fc --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreBackupHeaders.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 PreBackup operation. + */ +public class CloudEndpointsPreBackupHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders 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 CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreRestoreHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreRestoreHeaders.java new file mode 100644 index 00000000000..6662939cfba --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsPreRestoreHeaders.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 PreRestore operation. + */ +public class CloudEndpointsPreRestoreHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders 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 CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreHeatbeatHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreHeatbeatHeaders.java new file mode 100644 index 00000000000..5e945623ba9 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/CloudEndpointsRestoreHeatbeatHeaders.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 RestoreHeatbeat operation. + */ +public class CloudEndpointsRestoreHeatbeatHeaders { + /** + * 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 CloudEndpointsRestoreHeatbeatHeaders object itself. + */ + public CloudEndpointsRestoreHeatbeatHeaders 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 CloudEndpointsRestoreHeatbeatHeaders object itself. + */ + public CloudEndpointsRestoreHeatbeatHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Error.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Error.java new file mode 100644 index 00000000000..c2eee2102d9 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Error.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; + +/** + * Error type. + */ +public class Error { + /** + * Error code of the given entry. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message of the given entry. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Error details of the given entry. + */ + @JsonProperty(value = "details") + private ErrorDetails details; + + /** + * Get error code of the given entry. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of the given entry. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message of the given entry. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message of the given entry. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get error details of the given entry. + * + * @return the details value + */ + public ErrorDetails details() { + return this.details; + } + + /** + * Set error details of the given entry. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(ErrorDetails details) { + this.details = details; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorDetails.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorDetails.java new file mode 100644 index 00000000000..cefa83758ed --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorDetails.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; + +/** + * Error Details object. + */ +public class ErrorDetails { + /** + * Error code of the given entry. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message of the given entry. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Target of the given entry. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get error code of the given entry. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of the given entry. + * + * @param code the code value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message of the given entry. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message of the given entry. + * + * @param message the message value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get target of the given entry. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set target of the given entry. + * + * @param target the target value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorException.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorException.java new file mode 100644 index 00000000000..66be00105b9 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ErrorException.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.storagesync; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/GetSyncGroupsListByStorageSyncServiceHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/GetSyncGroupsListByStorageSyncServiceHeaders.java new file mode 100644 index 00000000000..19f63412a91 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/GetSyncGroupsListByStorageSyncServiceHeaders.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 ListByStorageSyncService operation. + */ +public class GetSyncGroupsListByStorageSyncServiceHeaders { + /** + * 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 GetSyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public GetSyncGroupsListByStorageSyncServiceHeaders 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 GetSyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public GetSyncGroupsListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayInfo.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayInfo.java new file mode 100644 index 00000000000..353e1bb3282 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayInfo.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation supported by storage sync. + */ +public class OperationDisplayInfo { + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The action that users can perform, based on their permission level. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Service provider: Microsoft StorageSync. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the action that users can perform, based on their permission level. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the action that users can perform, based on their permission level. + * + * @param operation the operation value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get service provider: Microsoft StorageSync. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft StorageSync. + * + * @param provider the provider value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withResource(String resource) { + this.resource = resource; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayResource.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayResource.java new file mode 100644 index 00000000000..6c1199f7f53 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationDisplayResource.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation Display Resource object. + */ +public class OperationDisplayResource { + /** + * Operation Display Resource Provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Operation Display Resource. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation Display Resource Operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation Display Resource Description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get operation Display Resource Provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set operation Display Resource Provider. + * + * @param provider the provider value to set + * @return the OperationDisplayResource object itself. + */ + public OperationDisplayResource withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get operation Display Resource. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set operation Display Resource. + * + * @param resource the resource value to set + * @return the OperationDisplayResource object itself. + */ + public OperationDisplayResource withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation Display Resource Operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation Display Resource Operation. + * + * @param operation the operation value to set + * @return the OperationDisplayResource object itself. + */ + public OperationDisplayResource withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation Display Resource Description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation Display Resource Description. + * + * @param description the description value to set + * @return the OperationDisplayResource object itself. + */ + public OperationDisplayResource withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationGetListHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationGetListHeaders.java new file mode 100644 index 00000000000..1f555e50d16 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationGetListHeaders.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 list operation. + */ +public class OperationGetListHeaders { + /** + * 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 OperationGetListHeaders object itself. + */ + public OperationGetListHeaders 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 OperationGetListHeaders object itself. + */ + public OperationGetListHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationsListHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationsListHeaders.java new file mode 100644 index 00000000000..22758df10aa --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/OperationsListHeaders.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 List operation. + */ +public class OperationsListHeaders { + /** + * 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 OperationsListHeaders object itself. + */ + public OperationsListHeaders 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 OperationsListHeaders object itself. + */ + public OperationsListHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PostRestoreRequest.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PostRestoreRequest.java new file mode 100644 index 00000000000..f8a86cd6d82 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PostRestoreRequest.java @@ -0,0 +1,226 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Post Restore Request. + */ +public class PostRestoreRequest { + /** + * Post Restore partition. + */ + @JsonProperty(value = "partition") + private String partition; + + /** + * Post Restore replica group. + */ + @JsonProperty(value = "replicaGroup") + private String replicaGroup; + + /** + * Post Restore request id. + */ + @JsonProperty(value = "requestId") + private String requestId; + + /** + * Post Restore Azure file share uri. + */ + @JsonProperty(value = "azureFileShareUri") + private String azureFileShareUri; + + /** + * Post Restore Azure status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Post Restore Azure source azure file share uri. + */ + @JsonProperty(value = "sourceAzureFileShareUri") + private String sourceAzureFileShareUri; + + /** + * Post Restore Azure failed file list. + */ + @JsonProperty(value = "failedFileList") + private String failedFileList; + + /** + * Post Restore restore file spec array. + */ + @JsonProperty(value = "restoreFileSpec") + private List restoreFileSpec; + + /** + * Get post Restore partition. + * + * @return the partition value + */ + public String partition() { + return this.partition; + } + + /** + * Set post Restore partition. + * + * @param partition the partition value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withPartition(String partition) { + this.partition = partition; + return this; + } + + /** + * Get post Restore replica group. + * + * @return the replicaGroup value + */ + public String replicaGroup() { + return this.replicaGroup; + } + + /** + * Set post Restore replica group. + * + * @param replicaGroup the replicaGroup value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withReplicaGroup(String replicaGroup) { + this.replicaGroup = replicaGroup; + return this; + } + + /** + * Get post Restore request id. + * + * @return the requestId value + */ + public String requestId() { + return this.requestId; + } + + /** + * Set post Restore request id. + * + * @param requestId the requestId value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get post Restore Azure file share uri. + * + * @return the azureFileShareUri value + */ + public String azureFileShareUri() { + return this.azureFileShareUri; + } + + /** + * Set post Restore Azure file share uri. + * + * @param azureFileShareUri the azureFileShareUri value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withAzureFileShareUri(String azureFileShareUri) { + this.azureFileShareUri = azureFileShareUri; + return this; + } + + /** + * Get post Restore Azure status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set post Restore Azure status. + * + * @param status the status value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get post Restore Azure source azure file share uri. + * + * @return the sourceAzureFileShareUri value + */ + public String sourceAzureFileShareUri() { + return this.sourceAzureFileShareUri; + } + + /** + * Set post Restore Azure source azure file share uri. + * + * @param sourceAzureFileShareUri the sourceAzureFileShareUri value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withSourceAzureFileShareUri(String sourceAzureFileShareUri) { + this.sourceAzureFileShareUri = sourceAzureFileShareUri; + return this; + } + + /** + * Get post Restore Azure failed file list. + * + * @return the failedFileList value + */ + public String failedFileList() { + return this.failedFileList; + } + + /** + * Set post Restore Azure failed file list. + * + * @param failedFileList the failedFileList value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withFailedFileList(String failedFileList) { + this.failedFileList = failedFileList; + return this; + } + + /** + * Get post Restore restore file spec array. + * + * @return the restoreFileSpec value + */ + public List restoreFileSpec() { + return this.restoreFileSpec; + } + + /** + * Set post Restore restore file spec array. + * + * @param restoreFileSpec the restoreFileSpec value to set + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withRestoreFileSpec(List restoreFileSpec) { + this.restoreFileSpec = restoreFileSpec; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PreRestoreRequest.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PreRestoreRequest.java new file mode 100644 index 00000000000..db4b20ddbed --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/PreRestoreRequest.java @@ -0,0 +1,252 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Pre Restore request object. + */ +public class PreRestoreRequest { + /** + * Pre Restore partition. + */ + @JsonProperty(value = "partition") + private String partition; + + /** + * Pre Restore replica group. + */ + @JsonProperty(value = "replicaGroup") + private String replicaGroup; + + /** + * Pre Restore request id. + */ + @JsonProperty(value = "requestId") + private String requestId; + + /** + * Pre Restore Azure file share uri. + */ + @JsonProperty(value = "azureFileShareUri") + private String azureFileShareUri; + + /** + * Pre Restore Azure status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Pre Restore Azure source azure file share uri. + */ + @JsonProperty(value = "sourceAzureFileShareUri") + private String sourceAzureFileShareUri; + + /** + * Pre Restore backup metadata property bag. + */ + @JsonProperty(value = "backupMetadataPropertyBag") + private String backupMetadataPropertyBag; + + /** + * Pre Restore restore file spec array. + */ + @JsonProperty(value = "restoreFileSpec") + private List restoreFileSpec; + + /** + * Pre Restore pause wait for sync drain time period in seconds. + */ + @JsonProperty(value = "pauseWaitForSyncDrainTimePeriodInSeconds") + private Integer pauseWaitForSyncDrainTimePeriodInSeconds; + + /** + * Get pre Restore partition. + * + * @return the partition value + */ + public String partition() { + return this.partition; + } + + /** + * Set pre Restore partition. + * + * @param partition the partition value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withPartition(String partition) { + this.partition = partition; + return this; + } + + /** + * Get pre Restore replica group. + * + * @return the replicaGroup value + */ + public String replicaGroup() { + return this.replicaGroup; + } + + /** + * Set pre Restore replica group. + * + * @param replicaGroup the replicaGroup value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withReplicaGroup(String replicaGroup) { + this.replicaGroup = replicaGroup; + return this; + } + + /** + * Get pre Restore request id. + * + * @return the requestId value + */ + public String requestId() { + return this.requestId; + } + + /** + * Set pre Restore request id. + * + * @param requestId the requestId value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get pre Restore Azure file share uri. + * + * @return the azureFileShareUri value + */ + public String azureFileShareUri() { + return this.azureFileShareUri; + } + + /** + * Set pre Restore Azure file share uri. + * + * @param azureFileShareUri the azureFileShareUri value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withAzureFileShareUri(String azureFileShareUri) { + this.azureFileShareUri = azureFileShareUri; + return this; + } + + /** + * Get pre Restore Azure status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set pre Restore Azure status. + * + * @param status the status value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get pre Restore Azure source azure file share uri. + * + * @return the sourceAzureFileShareUri value + */ + public String sourceAzureFileShareUri() { + return this.sourceAzureFileShareUri; + } + + /** + * Set pre Restore Azure source azure file share uri. + * + * @param sourceAzureFileShareUri the sourceAzureFileShareUri value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withSourceAzureFileShareUri(String sourceAzureFileShareUri) { + this.sourceAzureFileShareUri = sourceAzureFileShareUri; + return this; + } + + /** + * Get pre Restore backup metadata property bag. + * + * @return the backupMetadataPropertyBag value + */ + public String backupMetadataPropertyBag() { + return this.backupMetadataPropertyBag; + } + + /** + * Set pre Restore backup metadata property bag. + * + * @param backupMetadataPropertyBag the backupMetadataPropertyBag value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withBackupMetadataPropertyBag(String backupMetadataPropertyBag) { + this.backupMetadataPropertyBag = backupMetadataPropertyBag; + return this; + } + + /** + * Get pre Restore restore file spec array. + * + * @return the restoreFileSpec value + */ + public List restoreFileSpec() { + return this.restoreFileSpec; + } + + /** + * Set pre Restore restore file spec array. + * + * @param restoreFileSpec the restoreFileSpec value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withRestoreFileSpec(List restoreFileSpec) { + this.restoreFileSpec = restoreFileSpec; + return this; + } + + /** + * Get pre Restore pause wait for sync drain time period in seconds. + * + * @return the pauseWaitForSyncDrainTimePeriodInSeconds value + */ + public Integer pauseWaitForSyncDrainTimePeriodInSeconds() { + return this.pauseWaitForSyncDrainTimePeriodInSeconds; + } + + /** + * Set pre Restore pause wait for sync drain time period in seconds. + * + * @param pauseWaitForSyncDrainTimePeriodInSeconds the pauseWaitForSyncDrainTimePeriodInSeconds value to set + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withPauseWaitForSyncDrainTimePeriodInSeconds(Integer pauseWaitForSyncDrainTimePeriodInSeconds) { + this.pauseWaitForSyncDrainTimePeriodInSeconds = pauseWaitForSyncDrainTimePeriodInSeconds; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Reason.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Reason.java new file mode 100644 index 00000000000..6d2b38e4bf7 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/Reason.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.storagesync; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Reason. + */ +public final class Reason extends ExpandableStringEnum { + /** Static value Registered for Reason. */ + public static final Reason REGISTERED = fromString("Registered"); + + /** Static value Unregistered for Reason. */ + public static final Reason UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for Reason. */ + public static final Reason WARNED = fromString("Warned"); + + /** Static value Suspended for Reason. */ + public static final Reason SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for Reason. */ + public static final Reason DELETED = fromString("Deleted"); + + /** + * Creates or finds a Reason from its string representation. + * @param name a name to look for + * @return the corresponding Reason + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** + * @return known Reason values + */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersCreateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersCreateHeaders.java new file mode 100644 index 00000000000..42509bd5487 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersCreateHeaders.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class RegisteredServersCreateHeaders { + /** + * 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 = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * 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 RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders 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 RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set operation Status Location URI. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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 RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersDeleteHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersDeleteHeaders.java new file mode 100644 index 00000000000..3bd44d230ee --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersDeleteHeaders.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 Delete operation. + */ +public class RegisteredServersDeleteHeaders { + /** + * 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 RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders 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 RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders 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 RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetHeaders.java new file mode 100644 index 00000000000..c692fb0d385 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetHeaders.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 Get operation. + */ +public class RegisteredServersGetHeaders { + /** + * 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 RegisteredServersGetHeaders object itself. + */ + public RegisteredServersGetHeaders 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 RegisteredServersGetHeaders object itself. + */ + public RegisteredServersGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetListByStorageSyncServiceHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetListByStorageSyncServiceHeaders.java new file mode 100644 index 00000000000..47dc56ea2ec --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersGetListByStorageSyncServiceHeaders.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 ListByStorageSyncService operation. + */ +public class RegisteredServersGetListByStorageSyncServiceHeaders { + /** + * 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 RegisteredServersGetListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersGetListByStorageSyncServiceHeaders 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 RegisteredServersGetListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersGetListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersListByStorageSyncServiceHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersListByStorageSyncServiceHeaders.java new file mode 100644 index 00000000000..25e86f5fb16 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RegisteredServersListByStorageSyncServiceHeaders.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 ListByStorageSyncService operation. + */ +public class RegisteredServersListByStorageSyncServiceHeaders { + /** + * 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 RegisteredServersListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersListByStorageSyncServiceHeaders 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 RegisteredServersListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ResourcesMoveInfo.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ResourcesMoveInfo.java new file mode 100644 index 00000000000..4842520d802 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ResourcesMoveInfo.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.storagesync; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource Move Info. + */ +public class ResourcesMoveInfo { + /** + * Target resource group. + */ + @JsonProperty(value = "targetResourceGroup") + private String targetResourceGroup; + + /** + * Collection of Resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get target resource group. + * + * @return the targetResourceGroup value + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Set target resource group. + * + * @param targetResourceGroup the targetResourceGroup value to set + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withTargetResourceGroup(String targetResourceGroup) { + this.targetResourceGroup = targetResourceGroup; + return this; + } + + /** + * Get collection of Resources. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set collection of Resources. + * + * @param resources the resources value to set + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withResources(List resources) { + this.resources = resources; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RestoreFileSpec.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RestoreFileSpec.java new file mode 100644 index 00000000000..015aef21516 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/RestoreFileSpec.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Restore file spec. + */ +public class RestoreFileSpec { + /** + * Restore file spec path. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Restore file spec isdir. + */ + @JsonProperty(value = "isdir", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isdir; + + /** + * Get restore file spec path. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set restore file spec path. + * + * @param path the path value to set + * @return the RestoreFileSpec object itself. + */ + public RestoreFileSpec withPath(String path) { + this.path = path; + return this; + } + + /** + * Get restore file spec isdir. + * + * @return the isdir value + */ + public Boolean isdir() { + return this.isdir; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointRecallPostHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointRecallPostHeaders.java new file mode 100644 index 00000000000..a11284469a4 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointRecallPostHeaders.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 Post operation. + */ +public class ServerEndpointRecallPostHeaders { + /** + * 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 ServerEndpointRecallPostHeaders object itself. + */ + public ServerEndpointRecallPostHeaders 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 ServerEndpointRecallPostHeaders object itself. + */ + public ServerEndpointRecallPostHeaders 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 ServerEndpointRecallPostHeaders object itself. + */ + public ServerEndpointRecallPostHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsCreateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsCreateHeaders.java new file mode 100644 index 00000000000..e5cf0ce61f3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsCreateHeaders.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class ServerEndpointsCreateHeaders { + /** + * 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 = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * 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 ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders 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 ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set operation Status Location URI. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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 ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsDeleteHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsDeleteHeaders.java new file mode 100644 index 00000000000..734884e4992 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsDeleteHeaders.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 Delete operation. + */ +public class ServerEndpointsDeleteHeaders { + /** + * 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 ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders 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 ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders 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 ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetHeaders.java new file mode 100644 index 00000000000..d87b88afa54 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetHeaders.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 Get operation. + */ +public class ServerEndpointsGetHeaders { + /** + * 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 ServerEndpointsGetHeaders object itself. + */ + public ServerEndpointsGetHeaders 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 ServerEndpointsGetHeaders object itself. + */ + public ServerEndpointsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetListBySyncGroupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetListBySyncGroupHeaders.java new file mode 100644 index 00000000000..7c16828dee2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsGetListBySyncGroupHeaders.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 ListBySyncGroup operation. + */ +public class ServerEndpointsGetListBySyncGroupHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 ServerEndpointsGetListBySyncGroupHeaders object itself. + */ + public ServerEndpointsGetListBySyncGroupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 ServerEndpointsGetListBySyncGroupHeaders object itself. + */ + public ServerEndpointsGetListBySyncGroupHeaders 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 ServerEndpointsGetListBySyncGroupHeaders object itself. + */ + public ServerEndpointsGetListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsListBySyncGroupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsListBySyncGroupHeaders.java new file mode 100644 index 00000000000..6db5d5540c3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsListBySyncGroupHeaders.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 ListBySyncGroup operation. + */ +public class ServerEndpointsListBySyncGroupHeaders { + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * 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 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 ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders 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 ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallHeaders.java new file mode 100644 index 00000000000..cb5518b54f2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsRecallHeaders.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 Recall operation. + */ +public class ServerEndpointsRecallHeaders { + /** + * 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 ServerEndpointsRecallHeaders object itself. + */ + public ServerEndpointsRecallHeaders 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 ServerEndpointsRecallHeaders object itself. + */ + public ServerEndpointsRecallHeaders 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 ServerEndpointsRecallHeaders object itself. + */ + public ServerEndpointsRecallHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsUpdateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsUpdateHeaders.java new file mode 100644 index 00000000000..afa291d57d3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/ServerEndpointsUpdateHeaders.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.storagesync; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class ServerEndpointsUpdateHeaders { + /** + * 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 = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * 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 ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders 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 ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set operation Status Location URI. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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 ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncError.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncError.java new file mode 100644 index 00000000000..7dd668196a2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncError.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; + +/** + * Error type. + */ +public class StorageSyncError { + /** + * Error code of the given entry. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message of the given entry. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Error details of the given entry. + */ + @JsonProperty(value = "details") + private StorageSyncErrorDetails details; + + /** + * Get error code of the given entry. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of the given entry. + * + * @param code the code value to set + * @return the StorageSyncError object itself. + */ + public StorageSyncError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message of the given entry. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message of the given entry. + * + * @param message the message value to set + * @return the StorageSyncError object itself. + */ + public StorageSyncError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get error details of the given entry. + * + * @return the details value + */ + public StorageSyncErrorDetails details() { + return this.details; + } + + /** + * Set error details of the given entry. + * + * @param details the details value to set + * @return the StorageSyncError object itself. + */ + public StorageSyncError withDetails(StorageSyncErrorDetails details) { + this.details = details; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorDetails.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorDetails.java new file mode 100644 index 00000000000..df0a224eacf --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorDetails.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; + +/** + * Error Details object. + */ +public class StorageSyncErrorDetails { + /** + * Error code of the given entry. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message of the given entry. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Target of the given entry. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get error code of the given entry. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of the given entry. + * + * @param code the code value to set + * @return the StorageSyncErrorDetails object itself. + */ + public StorageSyncErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message of the given entry. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message of the given entry. + * + * @param message the message value to set + * @return the StorageSyncErrorDetails object itself. + */ + public StorageSyncErrorDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get target of the given entry. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set target of the given entry. + * + * @param target the target value to set + * @return the StorageSyncErrorDetails object itself. + */ + public StorageSyncErrorDetails withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorException.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorException.java new file mode 100644 index 00000000000..d38239dcf19 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncErrorException.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.storagesync; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with StorageSyncError information. + */ +public class StorageSyncErrorException extends RestException { + /** + * Initializes a new instance of the StorageSyncErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public StorageSyncErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the StorageSyncErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public StorageSyncErrorException(final String message, final Response response, final StorageSyncError body) { + super(message, response, body); + } + + @Override + public StorageSyncError body() { + return (StorageSyncError) super.body(); + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceByResourceGroupGetListHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceByResourceGroupGetListHeaders.java new file mode 100644 index 00000000000..56d397bc180 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceByResourceGroupGetListHeaders.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 list operation. + */ +public class StorageSyncServiceByResourceGroupGetListHeaders { + /** + * 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 StorageSyncServiceByResourceGroupGetListHeaders object itself. + */ + public StorageSyncServiceByResourceGroupGetListHeaders 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 StorageSyncServiceByResourceGroupGetListHeaders object itself. + */ + public StorageSyncServiceByResourceGroupGetListHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceGetListBySubscriptionHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceGetListBySubscriptionHeaders.java new file mode 100644 index 00000000000..6c5cac02fb5 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServiceGetListBySubscriptionHeaders.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 ListBySubscription operation. + */ +public class StorageSyncServiceGetListBySubscriptionHeaders { + /** + * 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 StorageSyncServiceGetListBySubscriptionHeaders object itself. + */ + public StorageSyncServiceGetListBySubscriptionHeaders 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 StorageSyncServiceGetListBySubscriptionHeaders object itself. + */ + public StorageSyncServiceGetListBySubscriptionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesDeleteHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesDeleteHeaders.java new file mode 100644 index 00000000000..b8bd59338f7 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesDeleteHeaders.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 Delete operation. + */ +public class StorageSyncServicesDeleteHeaders { + /** + * 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 StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders 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 StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesGetHeaders.java new file mode 100644 index 00000000000..ab6b9a3a0e6 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesGetHeaders.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 Get operation. + */ +public class StorageSyncServicesGetHeaders { + /** + * 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 StorageSyncServicesGetHeaders object itself. + */ + public StorageSyncServicesGetHeaders 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 StorageSyncServicesGetHeaders object itself. + */ + public StorageSyncServicesGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListByResourceGroupHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListByResourceGroupHeaders.java new file mode 100644 index 00000000000..709fcd4f28d --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListByResourceGroupHeaders.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 ListByResourceGroup operation. + */ +public class StorageSyncServicesListByResourceGroupHeaders { + /** + * 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 StorageSyncServicesListByResourceGroupHeaders object itself. + */ + public StorageSyncServicesListByResourceGroupHeaders 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 StorageSyncServicesListByResourceGroupHeaders object itself. + */ + public StorageSyncServicesListByResourceGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListBySubscriptionHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListBySubscriptionHeaders.java new file mode 100644 index 00000000000..04196dd79a5 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesListBySubscriptionHeaders.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 ListBySubscription operation. + */ +public class StorageSyncServicesListBySubscriptionHeaders { + /** + * 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 StorageSyncServicesListBySubscriptionHeaders object itself. + */ + public StorageSyncServicesListBySubscriptionHeaders 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 StorageSyncServicesListBySubscriptionHeaders object itself. + */ + public StorageSyncServicesListBySubscriptionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesUpdateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesUpdateHeaders.java new file mode 100644 index 00000000000..18e17c2cccb --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/StorageSyncServicesUpdateHeaders.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 Update operation. + */ +public class StorageSyncServicesUpdateHeaders { + /** + * 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 StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders 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 StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SubscriptionState.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SubscriptionState.java new file mode 100644 index 00000000000..a05998fadef --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SubscriptionState.java @@ -0,0 +1,85 @@ +/** + * 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; + +/** + * Subscription State object. + */ +public class SubscriptionState { + /** + * State of Azure Subscription. Possible values include: 'Registered', + * 'Unregistered', 'Warned', 'Suspended', 'Deleted'. + */ + @JsonProperty(value = "state") + private Reason state; + + /** + * Is Transitioning. + */ + @JsonProperty(value = "istransitioning", access = JsonProperty.Access.WRITE_ONLY) + private Boolean istransitioning; + + /** + * Subscription state properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get state of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted'. + * + * @return the state value + */ + public Reason state() { + return this.state; + } + + /** + * Set state of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted'. + * + * @param state the state value to set + * @return the SubscriptionState object itself. + */ + public SubscriptionState withState(Reason state) { + this.state = state; + return this; + } + + /** + * Get is Transitioning. + * + * @return the istransitioning value + */ + public Boolean istransitioning() { + return this.istransitioning; + } + + /** + * Get subscription state properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set subscription state properties. + * + * @param properties the properties value to set + * @return the SubscriptionState object itself. + */ + public SubscriptionState withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsCreateHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsCreateHeaders.java new file mode 100644 index 00000000000..f7e7311ddc7 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsCreateHeaders.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 Create operation. + */ +public class SyncGroupsCreateHeaders { + /** + * 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 SyncGroupsCreateHeaders object itself. + */ + public SyncGroupsCreateHeaders 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 SyncGroupsCreateHeaders object itself. + */ + public SyncGroupsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsDeleteHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsDeleteHeaders.java new file mode 100644 index 00000000000..19cc4fba2f2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsDeleteHeaders.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 Delete operation. + */ +public class SyncGroupsDeleteHeaders { + /** + * 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 SyncGroupsDeleteHeaders object itself. + */ + public SyncGroupsDeleteHeaders 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 SyncGroupsDeleteHeaders object itself. + */ + public SyncGroupsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsGetHeaders.java new file mode 100644 index 00000000000..029c8c2479f --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsGetHeaders.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 Get operation. + */ +public class SyncGroupsGetHeaders { + /** + * 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 SyncGroupsGetHeaders object itself. + */ + public SyncGroupsGetHeaders 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 SyncGroupsGetHeaders object itself. + */ + public SyncGroupsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsListByStorageSyncServiceHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsListByStorageSyncServiceHeaders.java new file mode 100644 index 00000000000..19723a2e7ac --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/SyncGroupsListByStorageSyncServiceHeaders.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 ListByStorageSyncService operation. + */ +public class SyncGroupsListByStorageSyncServiceHeaders { + /** + * 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 SyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public SyncGroupsListByStorageSyncServiceHeaders 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 SyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public SyncGroupsListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowArray.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowArray.java new file mode 100644 index 00000000000..0319087b8b1 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowArray.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync; + +import java.util.List; +import com.microsoft.azure.management.storagesync.implementation.WorkflowInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Array of Workflow. + */ +public class WorkflowArray { + /** + * Collection of workflow items. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get collection of workflow items. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set collection of workflow items. + * + * @param value the value value to set + * @return the WorkflowArray object itself. + */ + public WorkflowArray withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsAbortHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsAbortHeaders.java new file mode 100644 index 00000000000..f73598c2ff4 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsAbortHeaders.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 Abort operation. + */ +public class WorkflowsAbortHeaders { + /** + * 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 WorkflowsAbortHeaders object itself. + */ + public WorkflowsAbortHeaders 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 WorkflowsAbortHeaders object itself. + */ + public WorkflowsAbortHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsGetHeaders.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsGetHeaders.java new file mode 100644 index 00000000000..893005a1de9 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/WorkflowsGetHeaders.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 Get operation. + */ +public class WorkflowsGetHeaders { + /** + * 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 WorkflowsGetHeaders object itself. + */ + public WorkflowsGetHeaders 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 WorkflowsGetHeaders object itself. + */ + public WorkflowsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/AbortWorkflowsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/AbortWorkflowsInner.java new file mode 100644 index 00000000000..870a9fb609f --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/AbortWorkflowsInner.java @@ -0,0 +1,153 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.AbortWorkflowsPostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AbortWorkflows. + */ +public class AbortWorkflowsInner { + /** The Retrofit service to perform REST calls. */ + private AbortWorkflowsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of AbortWorkflowsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AbortWorkflowsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(AbortWorkflowsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AbortWorkflows to be + * used by Retrofit to perform actually REST calls. + */ + interface AbortWorkflowsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.AbortWorkflows post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort") + Observable> post(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("workflowId") String workflowId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String workflowId) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).toBlocking().single().body(); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String workflowId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId), serviceCallback); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> postWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (workflowId == null) { + throw new IllegalArgumentException("Parameter workflowId 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.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, workflowId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = postDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders postDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, AbortWorkflowsPostHeaders.class); + } + +} 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 new file mode 100644 index 00000000000..58959d5cc17 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointInner.java @@ -0,0 +1,269 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Cloud Endpoint object. + */ +@JsonFlatten +public class CloudEndpointInner extends ProxyResource { + /** + * Storage Account access key. + */ + @JsonProperty(value = "properties.storageAccountKey") + private String storageAccountKey; + + /** + * Storage Account name. + */ + @JsonProperty(value = "properties.storageAccount") + private String storageAccount; + + /** + * Storage Account Resource Id. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /** + * Storage Account Share name. + */ + @JsonProperty(value = "properties.storageAccountShareName") + private String storageAccountShareName; + + /** + * Storage Account Tenant Id. + */ + @JsonProperty(value = "properties.storageAccountTenantId") + private String storageAccountTenantId; + + /** + * Partnership Id. + */ + @JsonProperty(value = "properties.partnershipId") + private String partnershipId; + + /** + * Friendly Name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Backup Enabled. + */ + @JsonProperty(value = "properties.backupEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean backupEnabled; + + /** + * CloudEndpoint Provisioning State. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * CloudEndpoint lastWorkflowId. + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /** + * Get storage Account access key. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set storage Account access key. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + + /** + * Get storage Account name. + * + * @return the storageAccount value + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set storage Account name. + * + * @param storageAccount the storageAccount value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get storage Account Resource Id. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set storage Account Resource Id. + * + * @param storageAccountResourceId the storageAccountResourceId value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get storage Account Share name. + * + * @return the storageAccountShareName value + */ + public String storageAccountShareName() { + return this.storageAccountShareName; + } + + /** + * Set storage Account Share name. + * + * @param storageAccountShareName the storageAccountShareName value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountShareName(String storageAccountShareName) { + this.storageAccountShareName = storageAccountShareName; + return this; + } + + /** + * Get storage Account Tenant Id. + * + * @return the storageAccountTenantId value + */ + public String storageAccountTenantId() { + return this.storageAccountTenantId; + } + + /** + * Set storage Account Tenant Id. + * + * @param storageAccountTenantId the storageAccountTenantId value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountTenantId(String storageAccountTenantId) { + this.storageAccountTenantId = storageAccountTenantId; + return this; + } + + /** + * Get partnership Id. + * + * @return the partnershipId value + */ + public String partnershipId() { + return this.partnershipId; + } + + /** + * Set partnership Id. + * + * @param partnershipId the partnershipId value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withPartnershipId(String partnershipId) { + this.partnershipId = partnershipId; + return this; + } + + /** + * Get friendly Name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly Name. + * + * @param friendlyName the friendlyName value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get backup Enabled. + * + * @return the backupEnabled value + */ + public Boolean backupEnabled() { + return this.backupEnabled; + } + + /** + * Get cloudEndpoint Provisioning State. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set cloudEndpoint Provisioning State. + * + * @param provisioningState the provisioningState value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get cloudEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Set cloudEndpoint lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastWorkflowId(String lastWorkflowId) { + this.lastWorkflowId = lastWorkflowId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostBackupsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostBackupsInner.java new file mode 100644 index 00000000000..2e6b1c77727 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostBackupsInner.java @@ -0,0 +1,444 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.BackupRequest; +import com.microsoft.azure.management.storagesync.CloudEndpointPostBackupPostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointPostBackups. + */ +public class CloudEndpointPostBackupsInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointPostBackupsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointPostBackupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointPostBackupsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointPostBackupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointPostBackups to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointPostBackupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPostBackups post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup") + Observable> post(@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, @Body BackupRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPostBackups beginPost" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup") + Observable> beginPost(@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, @Body BackupRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().last().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(null); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPostBackupPostHeaders.class); + } + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().last().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(azureFileShare); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPostBackupPostHeaders.class); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable> beginPostWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(null); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().single().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable> beginPostWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(azureFileShare); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointPostBackupPostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostRestoresInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostRestoresInner.java new file mode 100644 index 00000000000..7ebfb118b21 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPostRestoresInner.java @@ -0,0 +1,266 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.CloudEndpointPostRestorePostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.PostRestoreRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointPostRestores. + */ +public class CloudEndpointPostRestoresInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointPostRestoresService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointPostRestoresInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointPostRestoresInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointPostRestoresService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointPostRestores to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointPostRestoresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPostRestores post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore") + Observable> post(@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 PostRestoreRequest body, @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.CloudEndpointPostRestores beginPost" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore") + Observable> beginPost(@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 PostRestoreRequest body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).toBlocking().last().body(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body), serviceCallback); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPostRestorePostHeaders.class); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).toBlocking().single().body(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body), serviceCallback); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest body) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointPostRestorePostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreBackupsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreBackupsInner.java new file mode 100644 index 00000000000..9fc3a39d276 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreBackupsInner.java @@ -0,0 +1,440 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.BackupRequest; +import com.microsoft.azure.management.storagesync.CloudEndpointPreBackupPostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointPreBackups. + */ +public class CloudEndpointPreBackupsInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointPreBackupsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointPreBackupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointPreBackupsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointPreBackupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointPreBackups to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointPreBackupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPreBackups post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup") + Observable> post(@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, @Body BackupRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPreBackups beginPost" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup") + Observable> beginPost(@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, @Body BackupRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().last().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(null); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPreBackupPostHeaders.class); + } + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().last().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(azureFileShare); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPreBackupPostHeaders.class); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(null); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().single().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest body = new BackupRequest(); + body.withAzureFileShare(azureFileShare); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointPreBackupPostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreRestoresInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreRestoresInner.java new file mode 100644 index 00000000000..6a45f8151d0 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointPreRestoresInner.java @@ -0,0 +1,266 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.CloudEndpointPreRestorePostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.PreRestoreRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointPreRestores. + */ +public class CloudEndpointPreRestoresInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointPreRestoresService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointPreRestoresInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointPreRestoresInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointPreRestoresService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointPreRestores to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointPreRestoresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointPreRestores post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore") + Observable> post(@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 body, @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.CloudEndpointPreRestores beginPost" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore") + Observable> beginPost(@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 body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).toBlocking().last().body(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body), serviceCallback); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointPreRestorePostHeaders.class); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).toBlocking().single().body(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body), serviceCallback); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param body Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest body) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.beginPost(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointPreRestorePostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointRestoreHeatbeatsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointRestoreHeatbeatsInner.java new file mode 100644 index 00000000000..b85eca858db --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointRestoreHeatbeatsInner.java @@ -0,0 +1,160 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.CloudEndpointRestoreHeatbeatPostHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointRestoreHeatbeats. + */ +public class CloudEndpointRestoreHeatbeatsInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointRestoreHeatbeatsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointRestoreHeatbeatsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointRestoreHeatbeatsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointRestoreHeatbeatsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointRestoreHeatbeats to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointRestoreHeatbeatsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointRestoreHeatbeats post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat") + Observable> post(@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); + + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> postWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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.post(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) { + try { + ServiceResponseWithHeaders clientResponse = postDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders postDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointRestoreHeatbeatPostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsGetsInner.java new file mode 100644 index 00000000000..6ad74cbcdcf --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsGetsInner.java @@ -0,0 +1,160 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.CloudEndpointsGetListBySyncGroupHeaders; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpointsGets. + */ +public class CloudEndpointsGetsInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointsGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointsGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointsGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(CloudEndpointsGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpointsGets to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointsGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpointsGets listBySyncGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints") + 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); + + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<CloudEndpointInner> object if successful. + */ + public List listBySyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CloudEndpointInner> object + */ + public Observable> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, CloudEndpointsGetListBySyncGroupHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, CloudEndpointsGetListBySyncGroupHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CloudEndpointInner> object + */ + public Observable, CloudEndpointsGetListBySyncGroupHeaders>> listBySyncGroupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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.listBySyncGroup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, CloudEndpointsGetListBySyncGroupHeaders>>>() { + @Override + public Observable, CloudEndpointsGetListBySyncGroupHeaders>> call(Response response) { + try { + ServiceResponse> result = listBySyncGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, CloudEndpointsGetListBySyncGroupHeaders> listBySyncGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, CloudEndpointsGetListBySyncGroupHeaders.class); + } + +} 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 new file mode 100644 index 00000000000..9af6973fdaa --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/CloudEndpointsInner.java @@ -0,0 +1,1960 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.BackupRequest; +import com.microsoft.azure.management.storagesync.CloudEndpointsCreateHeaders; +import com.microsoft.azure.management.storagesync.CloudEndpointsDeleteHeaders; +import com.microsoft.azure.management.storagesync.CloudEndpointsGetHeaders; +import com.microsoft.azure.management.storagesync.CloudEndpointsListBySyncGroupHeaders; +import com.microsoft.azure.management.storagesync.CloudEndpointsPostBackupHeaders; +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.PostRestoreRequest; +import com.microsoft.azure.management.storagesync.PreRestoreRequest; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +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.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudEndpoints. + */ +public class CloudEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private CloudEndpointsService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of CloudEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudEndpointsInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(CloudEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}") + Observable> create(@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 CloudEndpointInner 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 beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}") + Observable> beginCreate(@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 CloudEndpointInner 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 get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}") + Observable> get(@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 delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@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 beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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 listBySyncGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints") + 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.CloudEndpoints preBackup" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup") + Observable> preBackup(@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, @Body BackupRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints beginPreBackup" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup") + Observable> beginPreBackup(@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, @Body BackupRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints postBackup" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup") + Observable> postBackup(@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, @Body BackupRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints beginPostBackup" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup") + Observable> beginPostBackup(@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, @Body BackupRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.CloudEndpoints preRestore" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore") + Observable> preRestore(@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 beginPreRestore" }) + @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" }) + @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); + + @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") + Observable> postRestore(@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 PostRestoreRequest 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 beginPostRestore" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore") + Observable> beginPostRestore(@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 PostRestoreRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CloudEndpointInner object if successful. + */ + public CloudEndpointInner create(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @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 storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, CloudEndpointInner>() { + @Override + public CloudEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsCreateHeaders.class); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CloudEndpointInner object if successful. + */ + public CloudEndpointInner beginCreate(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @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 storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, CloudEndpointInner>() { + @Override + public CloudEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, CloudEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(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, CloudEndpointsCreateHeaders.class); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CloudEndpointInner object if successful. + */ + public CloudEndpointInner get(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudEndpointInner object + */ + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, CloudEndpointInner>() { + @Override + public CloudEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudEndpointInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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(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) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(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, CloudEndpointsGetHeaders.class); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 delete(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().last().body(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsDeleteHeaders.class); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginDelete(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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.beginDelete(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) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, CloudEndpointsDeleteHeaders.class); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<CloudEndpointInner> object if successful. + */ + public List listBySyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CloudEndpointInner> object + */ + public Observable> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, CloudEndpointsListBySyncGroupHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, CloudEndpointsListBySyncGroupHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CloudEndpointInner> object + */ + public Observable, CloudEndpointsListBySyncGroupHeaders>> listBySyncGroupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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.listBySyncGroup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, CloudEndpointsListBySyncGroupHeaders>>>() { + @Override + public Observable, CloudEndpointsListBySyncGroupHeaders>> call(Response response) { + try { + ServiceResponse> result = listBySyncGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, CloudEndpointsListBySyncGroupHeaders> listBySyncGroupDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, CloudEndpointsListBySyncGroupHeaders.class); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 preBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().last().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> preBackupWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(null); + Observable> observable = service.preBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPreBackupHeaders.class); + } + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 preBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().last().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return preBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> preBackupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(azureFileShare); + Observable> observable = service.preBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPreBackupHeaders.class); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginPreBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 beginPreBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPreBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPreBackupWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(null); + return service.beginPreBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPreBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginPreBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().single().body(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 beginPreBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPreBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPreBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPreBackupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(azureFileShare); + return service.beginPreBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPreBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPreBackupDelegate(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, CloudEndpointsPreBackupHeaders.class); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner postBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().last().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postBackupWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(null); + Observable> observable = service.postBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPostBackupHeaders.class); + } + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner postBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().last().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return postBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postBackupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(azureFileShare); + Observable> observable = service.postBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPostBackupHeaders.class); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner beginPostBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 beginPostBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable beginPostBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable> beginPostBackupWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String azureFileShare = null; + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(null); + return service.beginPostBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PostBackupResponseInner object if successful. + */ + public PostBackupResponseInner beginPostBackup(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).toBlocking().single().body(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @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 beginPostBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare), serviceCallback); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable beginPostBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + return beginPostBackupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, azureFileShare).map(new Func1, PostBackupResponseInner>() { + @Override + public PostBackupResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param azureFileShare Azure File Share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PostBackupResponseInner object + */ + public Observable> beginPostBackupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, String azureFileShare) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BackupRequest parameters = new BackupRequest(); + parameters.withAzureFileShare(azureFileShare); + return service.beginPostBackup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostBackupDelegate(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, CloudEndpointsPostBackupHeaders.class); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 preRestore(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + preRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @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 preRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(preRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable preRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + return preRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> preRestoreWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.preRestore(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPreRestoreHeaders.class); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginPreRestore(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + beginPreRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @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 beginPreRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPreRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPreRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + return beginPreRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPreRestoreWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginPreRestore(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPreRestoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPreRestoreDelegate(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, CloudEndpointsPreRestoreHeaders.class); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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(); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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 restoreHeatbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(restoreHeatbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @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>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> restoreHeatbeatWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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.restoreHeatbeat(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) { + try { + ServiceResponseWithHeaders clientResponse = restoreHeatbeatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders restoreHeatbeatDelegate(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); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 postRestore(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + postRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @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 postRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + return postRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postRestoreWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.postRestore(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CloudEndpointsPostRestoreHeaders.class); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginPostRestore(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + beginPostRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @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 beginPostRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters), serviceCallback); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + return beginPostRestoreWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostRestoreWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (cloudEndpointName == null) { + throw new IllegalArgumentException("Parameter cloudEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginPostRestore(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostRestoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostRestoreDelegate(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, CloudEndpointsPostRestoreHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/GetSyncGroupsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/GetSyncGroupsInner.java new file mode 100644 index 00000000000..537a1505e1f --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/GetSyncGroupsInner.java @@ -0,0 +1,153 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.GetSyncGroupsListByStorageSyncServiceHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in GetSyncGroups. + */ +public class GetSyncGroupsInner { + /** The Retrofit service to perform REST calls. */ + private GetSyncGroupsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of GetSyncGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GetSyncGroupsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(GetSyncGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for GetSyncGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface GetSyncGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.GetSyncGroups listByStorageSyncService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups") + Observable> listByStorageSyncService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SyncGroupInner> object if successful. + */ + public List listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @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> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SyncGroupInner> object + */ + public Observable> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, GetSyncGroupsListByStorageSyncServiceHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, GetSyncGroupsListByStorageSyncServiceHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SyncGroupInner> object + */ + public Observable, GetSyncGroupsListByStorageSyncServiceHeaders>> listByStorageSyncServiceWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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.listByStorageSyncService(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, GetSyncGroupsListByStorageSyncServiceHeaders>>>() { + @Override + public Observable, GetSyncGroupsListByStorageSyncServiceHeaders>> call(Response response) { + try { + ServiceResponse> result = listByStorageSyncServiceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, GetSyncGroupsListByStorageSyncServiceHeaders> listByStorageSyncServiceDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, GetSyncGroupsListByStorageSyncServiceHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/MicrosoftStorageSyncImpl.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/MicrosoftStorageSyncImpl.java new file mode 100644 index 00000000000..7eedb650857 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/MicrosoftStorageSyncImpl.java @@ -0,0 +1,462 @@ +/** + * 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.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftStorageSyncImpl class. + */ +public class MicrosoftStorageSyncImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftStorageSyncImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftStorageSyncImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MicrosoftStorageSyncImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MicrosoftStorageSyncImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationGetsInner object to access its operations. + */ + private OperationGetsInner operationGets; + + /** + * Gets the OperationGetsInner object to access its operations. + * @return the OperationGetsInner object. + */ + public OperationGetsInner operationGets() { + return this.operationGets; + } + + /** + * The StorageSyncServicesInner object to access its operations. + */ + private StorageSyncServicesInner storageSyncServices; + + /** + * Gets the StorageSyncServicesInner object to access its operations. + * @return the StorageSyncServicesInner object. + */ + public StorageSyncServicesInner storageSyncServices() { + return this.storageSyncServices; + } + + /** + * The StorageSyncServiceByResourceGroupGetsInner object to access its operations. + */ + private StorageSyncServiceByResourceGroupGetsInner storageSyncServiceByResourceGroupGets; + + /** + * Gets the StorageSyncServiceByResourceGroupGetsInner object to access its operations. + * @return the StorageSyncServiceByResourceGroupGetsInner object. + */ + public StorageSyncServiceByResourceGroupGetsInner storageSyncServiceByResourceGroupGets() { + return this.storageSyncServiceByResourceGroupGets; + } + + /** + * The StorageSyncServiceGetsInner object to access its operations. + */ + private StorageSyncServiceGetsInner storageSyncServiceGets; + + /** + * Gets the StorageSyncServiceGetsInner object to access its operations. + * @return the StorageSyncServiceGetsInner object. + */ + public StorageSyncServiceGetsInner storageSyncServiceGets() { + return this.storageSyncServiceGets; + } + + /** + * The GetSyncGroupsInner object to access its operations. + */ + private GetSyncGroupsInner getSyncGroups; + + /** + * Gets the GetSyncGroupsInner object to access its operations. + * @return the GetSyncGroupsInner object. + */ + public GetSyncGroupsInner getSyncGroups() { + return this.getSyncGroups; + } + + /** + * The SyncGroupsInner object to access its operations. + */ + private SyncGroupsInner syncGroups; + + /** + * Gets the SyncGroupsInner object to access its operations. + * @return the SyncGroupsInner object. + */ + public SyncGroupsInner syncGroups() { + return this.syncGroups; + } + + /** + * The CloudEndpointsInner object to access its operations. + */ + private CloudEndpointsInner cloudEndpoints; + + /** + * Gets the CloudEndpointsInner object to access its operations. + * @return the CloudEndpointsInner object. + */ + public CloudEndpointsInner cloudEndpoints() { + return this.cloudEndpoints; + } + + /** + * The CloudEndpointsGetsInner object to access its operations. + */ + private CloudEndpointsGetsInner cloudEndpointsGets; + + /** + * Gets the CloudEndpointsGetsInner object to access its operations. + * @return the CloudEndpointsGetsInner object. + */ + public CloudEndpointsGetsInner cloudEndpointsGets() { + return this.cloudEndpointsGets; + } + + /** + * The CloudEndpointPreBackupsInner object to access its operations. + */ + private CloudEndpointPreBackupsInner cloudEndpointPreBackups; + + /** + * Gets the CloudEndpointPreBackupsInner object to access its operations. + * @return the CloudEndpointPreBackupsInner object. + */ + public CloudEndpointPreBackupsInner cloudEndpointPreBackups() { + return this.cloudEndpointPreBackups; + } + + /** + * The CloudEndpointPostBackupsInner object to access its operations. + */ + private CloudEndpointPostBackupsInner cloudEndpointPostBackups; + + /** + * Gets the CloudEndpointPostBackupsInner object to access its operations. + * @return the CloudEndpointPostBackupsInner object. + */ + public CloudEndpointPostBackupsInner cloudEndpointPostBackups() { + return this.cloudEndpointPostBackups; + } + + /** + * The CloudEndpointPreRestoresInner object to access its operations. + */ + private CloudEndpointPreRestoresInner cloudEndpointPreRestores; + + /** + * Gets the CloudEndpointPreRestoresInner object to access its operations. + * @return the CloudEndpointPreRestoresInner object. + */ + public CloudEndpointPreRestoresInner cloudEndpointPreRestores() { + return this.cloudEndpointPreRestores; + } + + /** + * The CloudEndpointRestoreHeatbeatsInner object to access its operations. + */ + private CloudEndpointRestoreHeatbeatsInner cloudEndpointRestoreHeatbeats; + + /** + * Gets the CloudEndpointRestoreHeatbeatsInner object to access its operations. + * @return the CloudEndpointRestoreHeatbeatsInner object. + */ + public CloudEndpointRestoreHeatbeatsInner cloudEndpointRestoreHeatbeats() { + return this.cloudEndpointRestoreHeatbeats; + } + + /** + * The CloudEndpointPostRestoresInner object to access its operations. + */ + private CloudEndpointPostRestoresInner cloudEndpointPostRestores; + + /** + * Gets the CloudEndpointPostRestoresInner object to access its operations. + * @return the CloudEndpointPostRestoresInner object. + */ + public CloudEndpointPostRestoresInner cloudEndpointPostRestores() { + return this.cloudEndpointPostRestores; + } + + /** + * The ServerEndpointsInner object to access its operations. + */ + private ServerEndpointsInner serverEndpoints; + + /** + * Gets the ServerEndpointsInner object to access its operations. + * @return the ServerEndpointsInner object. + */ + public ServerEndpointsInner serverEndpoints() { + return this.serverEndpoints; + } + + /** + * The ServerEndpointsGetsInner object to access its operations. + */ + private ServerEndpointsGetsInner serverEndpointsGets; + + /** + * Gets the ServerEndpointsGetsInner object to access its operations. + * @return the ServerEndpointsGetsInner object. + */ + public ServerEndpointsGetsInner serverEndpointsGets() { + return this.serverEndpointsGets; + } + + /** + * The ServerEndpointRecallsInner object to access its operations. + */ + private ServerEndpointRecallsInner serverEndpointRecalls; + + /** + * Gets the ServerEndpointRecallsInner object to access its operations. + * @return the ServerEndpointRecallsInner object. + */ + public ServerEndpointRecallsInner serverEndpointRecalls() { + return this.serverEndpointRecalls; + } + + /** + * The RegisteredServersGetsInner object to access its operations. + */ + private RegisteredServersGetsInner registeredServersGets; + + /** + * Gets the RegisteredServersGetsInner object to access its operations. + * @return the RegisteredServersGetsInner object. + */ + public RegisteredServersGetsInner registeredServersGets() { + return this.registeredServersGets; + } + + /** + * The RegisteredServersInner object to access its operations. + */ + private RegisteredServersInner registeredServers; + + /** + * Gets the RegisteredServersInner object to access its operations. + * @return the RegisteredServersInner object. + */ + public RegisteredServersInner registeredServers() { + return this.registeredServers; + } + + /** + * The WorkflowsInner object to access its operations. + */ + private WorkflowsInner workflows; + + /** + * Gets the WorkflowsInner object to access its operations. + * @return the WorkflowsInner object. + */ + public WorkflowsInner workflows() { + return this.workflows; + } + + /** + * The AbortWorkflowsInner object to access its operations. + */ + private AbortWorkflowsInner abortWorkflows; + + /** + * Gets the AbortWorkflowsInner object to access its operations. + * @return the AbortWorkflowsInner object. + */ + public AbortWorkflowsInner abortWorkflows() { + return this.abortWorkflows; + } + + /** + * Initializes an instance of MicrosoftStorageSync client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftStorageSyncImpl(ServiceClientCredentials credentials) { + this("https://azure.microsoft.com", credentials); + } + + /** + * Initializes an instance of MicrosoftStorageSync client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftStorageSyncImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftStorageSync client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftStorageSyncImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-06-05-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operationGets = new OperationGetsInner(restClient().retrofit(), this); + this.storageSyncServices = new StorageSyncServicesInner(restClient().retrofit(), this); + this.storageSyncServiceByResourceGroupGets = new StorageSyncServiceByResourceGroupGetsInner(restClient().retrofit(), this); + this.storageSyncServiceGets = new StorageSyncServiceGetsInner(restClient().retrofit(), this); + this.getSyncGroups = new GetSyncGroupsInner(restClient().retrofit(), this); + this.syncGroups = new SyncGroupsInner(restClient().retrofit(), this); + this.cloudEndpoints = new CloudEndpointsInner(restClient().retrofit(), this); + this.cloudEndpointsGets = new CloudEndpointsGetsInner(restClient().retrofit(), this); + this.cloudEndpointPreBackups = new CloudEndpointPreBackupsInner(restClient().retrofit(), this); + this.cloudEndpointPostBackups = new CloudEndpointPostBackupsInner(restClient().retrofit(), this); + this.cloudEndpointPreRestores = new CloudEndpointPreRestoresInner(restClient().retrofit(), this); + this.cloudEndpointRestoreHeatbeats = new CloudEndpointRestoreHeatbeatsInner(restClient().retrofit(), this); + this.cloudEndpointPostRestores = new CloudEndpointPostRestoresInner(restClient().retrofit(), this); + this.serverEndpoints = new ServerEndpointsInner(restClient().retrofit(), this); + this.serverEndpointsGets = new ServerEndpointsGetsInner(restClient().retrofit(), this); + this.serverEndpointRecalls = new ServerEndpointRecallsInner(restClient().retrofit(), this); + this.registeredServersGets = new RegisteredServersGetsInner(restClient().retrofit(), this); + this.registeredServers = new RegisteredServersInner(restClient().retrofit(), this); + this.workflows = new WorkflowsInner(restClient().retrofit(), this); + this.abortWorkflows = new AbortWorkflowsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "MicrosoftStorageSync", "2017-06-05-preview"); + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationEntityInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationEntityInner.java new file mode 100644 index 00000000000..1fdb824a69d --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationEntityInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import com.microsoft.azure.management.storagesync.OperationDisplayInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation supported by storage sync. + */ +public class OperationEntityInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The operation supported by storage sync. + */ + @JsonProperty(value = "display") + private OperationDisplayInfo display; + + /** + * The origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operation supported by storage sync. + * + * @return the display value + */ + public OperationDisplayInfo display() { + return this.display; + } + + /** + * Set the operation supported by storage sync. + * + * @param display the display value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withDisplay(OperationDisplayInfo display) { + this.display = display; + return this; + } + + /** + * Get the origin. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin. + * + * @param origin the origin value to set + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withOrigin(String origin) { + this.origin = origin; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationGetsInner.java new file mode 100644 index 00000000000..77efae2b3ad --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationGetsInner.java @@ -0,0 +1,284 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.OperationGetListHeaders; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +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 OperationGets. + */ +public class OperationGetsInner { + /** The Retrofit service to perform REST calls. */ + private OperationGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of OperationGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(OperationGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for OperationGets to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.OperationGets list" }) + @GET("providers/Microsoft.StorageSync/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.storagesync.OperationGets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<OperationEntityInner> object if successful. + */ + public PagedList list() { + ServiceResponseWithHeaders, OperationGetListHeaders> 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 Storage Sync Rest API operations. + * + * @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.fromHeaderPageResponse( + listSinglePageAsync(), + new Func1, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1, OperationGetListHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, OperationGetListHeaders> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable, OperationGetListHeaders>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1, OperationGetListHeaders>, Observable, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(ServiceResponseWithHeaders, OperationGetListHeaders> 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 Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponseWithHeaders} if successful. + */ + public Observable, OperationGetListHeaders>> 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, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(Response response) { + try { + ServiceResponseWithHeaders, OperationGetListHeaders> result = listDelegate(response); + return Observable.just(new ServiceResponseWithHeaders, OperationGetListHeaders>(result.body(), result.headers(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, OperationGetListHeaders> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, OperationGetListHeaders.class); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<OperationEntityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponseWithHeaders, OperationGetListHeaders> 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 Storage Sync Rest API operations. + * + * @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.fromHeaderPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @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<OperationEntityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1, OperationGetListHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, OperationGetListHeaders> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @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<OperationEntityInner> object + */ + public Observable, OperationGetListHeaders>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1, OperationGetListHeaders>, Observable, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(ServiceResponseWithHeaders, OperationGetListHeaders> 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 Storage Sync Rest API operations. + * + ServiceResponseWithHeaders, OperationGetListHeaders> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponseWithHeaders} if successful. + */ + public Observable, OperationGetListHeaders>> 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, OperationGetListHeaders>>>() { + @Override + public Observable, OperationGetListHeaders>> call(Response response) { + try { + ServiceResponseWithHeaders, OperationGetListHeaders> result = listNextDelegate(response); + return Observable.just(new ServiceResponseWithHeaders, OperationGetListHeaders>(result.body(), result.headers(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, OperationGetListHeaders> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, OperationGetListHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationsInner.java new file mode 100644 index 00000000000..7c790ee5d92 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/OperationsInner.java @@ -0,0 +1,284 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storagesync.OperationsListHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +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 StorageSyncManagementClientImpl 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, StorageSyncManagementClientImpl 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.storagesync.Operations list" }) + @GET("providers/Microsoft.StorageSync/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.storagesync.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException 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<OperationEntityInner> object if successful. + */ + public PagedList list() { + ServiceResponseWithHeaders, OperationsListHeaders> 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 Storage Sync Rest API operations. + * + * @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.fromHeaderPageResponse( + listSinglePageAsync(), + new Func1, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1, OperationsListHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, OperationsListHeaders> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationEntityInner> object + */ + public Observable, OperationsListHeaders>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1, OperationsListHeaders>, Observable, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(ServiceResponseWithHeaders, OperationsListHeaders> 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 Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponseWithHeaders} if successful. + */ + public Observable, OperationsListHeaders>> 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, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(Response response) { + try { + ServiceResponseWithHeaders, OperationsListHeaders> result = listDelegate(response); + return Observable.just(new ServiceResponseWithHeaders, OperationsListHeaders>(result.body(), result.headers(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, OperationsListHeaders> listDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, OperationsListHeaders.class); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException 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<OperationEntityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponseWithHeaders, OperationsListHeaders> 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 Storage Sync Rest API operations. + * + * @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.fromHeaderPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @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<OperationEntityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1, OperationsListHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, OperationsListHeaders> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @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<OperationEntityInner> object + */ + public Observable, OperationsListHeaders>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1, OperationsListHeaders>, Observable, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(ServiceResponseWithHeaders, OperationsListHeaders> 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 Storage Sync Rest API operations. + * + ServiceResponseWithHeaders, OperationsListHeaders> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationEntityInner> object wrapped in {@link ServiceResponseWithHeaders} if successful. + */ + public Observable, OperationsListHeaders>> 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, OperationsListHeaders>>>() { + @Override + public Observable, OperationsListHeaders>> call(Response response) { + try { + ServiceResponseWithHeaders, OperationsListHeaders> result = listNextDelegate(response); + return Observable.just(new ServiceResponseWithHeaders, OperationsListHeaders>(result.body(), result.headers(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, OperationsListHeaders> listNextDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, OperationsListHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl.java new file mode 100644 index 00000000000..8ee8cb9a48d --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl1.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl1.java new file mode 100644 index 00000000000..f103ccb999c --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PostBackupResponseInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PostBackupResponseInner.java new file mode 100644 index 00000000000..1a645167b46 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/PostBackupResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Post Backup Response. + */ +@JsonFlatten +public class PostBackupResponseInner { + /** + * cloud endpoint Name. + */ + @JsonProperty(value = "backupMetadata.cloudEndpointName", access = JsonProperty.Access.WRITE_ONLY) + private String cloudEndpointName; + + /** + * Get cloud endpoint Name. + * + * @return the cloudEndpointName value + */ + public String cloudEndpointName() { + return this.cloudEndpointName; + } + +} 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 new file mode 100644 index 00000000000..2bb1367fb1e --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServerInner.java @@ -0,0 +1,376 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Registered Server resource. + */ +@JsonFlatten +public class RegisteredServerInner { + /** + * 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; + + /** + * Registered Server Certificate. + */ + @JsonProperty(value = "properties.serverCertificate") + private String serverCertificate; + + /** + * Registered Server Agent Version. + */ + @JsonProperty(value = "properties.agentVersion") + private String agentVersion; + + /** + * Registered Server OS Version. + */ + @JsonProperty(value = "properties.serverOSVersion") + private String serverOSVersion; + + /** + * Registered Server Management Error Code. + */ + @JsonProperty(value = "properties.serverManagementtErrorCode") + private Integer serverManagementtErrorCode; + + /** + * Registered Server last heart beat. + */ + @JsonProperty(value = "properties.lastHeartBeat") + private String lastHeartBeat; + + /** + * Registered Server Provisioning State. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Registered Server serverRole. + */ + @JsonProperty(value = "properties.serverRole") + private String serverRole; + + /** + * Registered Server clusterId. + */ + @JsonProperty(value = "properties.clusterId") + private String clusterId; + + /** + * Registered Server clusterName. + */ + @JsonProperty(value = "properties.clusterName") + private String clusterName; + + /** + * Registered Server serverId. + */ + @JsonProperty(value = "properties.serverId") + private String serverId; + + /** + * Registered Server storageSyncServiceUid. + */ + @JsonProperty(value = "properties.storageSyncServiceUid") + private String storageSyncServiceUid; + + /** + * Registered Server lastWorkflowId. + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get registered Server Certificate. + * + * @return the serverCertificate value + */ + public String serverCertificate() { + return this.serverCertificate; + } + + /** + * Set registered Server Certificate. + * + * @param serverCertificate the serverCertificate value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerCertificate(String serverCertificate) { + this.serverCertificate = serverCertificate; + return this; + } + + /** + * Get registered Server Agent Version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set registered Server Agent Version. + * + * @param agentVersion the agentVersion value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get registered Server OS Version. + * + * @return the serverOSVersion value + */ + public String serverOSVersion() { + return this.serverOSVersion; + } + + /** + * Set registered Server OS Version. + * + * @param serverOSVersion the serverOSVersion value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerOSVersion(String serverOSVersion) { + this.serverOSVersion = serverOSVersion; + return this; + } + + /** + * Get registered Server Management Error Code. + * + * @return the serverManagementtErrorCode value + */ + public Integer serverManagementtErrorCode() { + return this.serverManagementtErrorCode; + } + + /** + * Set registered Server Management Error Code. + * + * @param serverManagementtErrorCode the serverManagementtErrorCode value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerManagementtErrorCode(Integer serverManagementtErrorCode) { + this.serverManagementtErrorCode = serverManagementtErrorCode; + return this; + } + + /** + * Get registered Server last heart beat. + * + * @return the lastHeartBeat value + */ + public String lastHeartBeat() { + return this.lastHeartBeat; + } + + /** + * Set registered Server last heart beat. + * + * @param lastHeartBeat the lastHeartBeat value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastHeartBeat(String lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + return this; + } + + /** + * Get registered Server Provisioning State. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set registered Server Provisioning State. + * + * @param provisioningState the provisioningState value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get registered Server serverRole. + * + * @return the serverRole value + */ + public String serverRole() { + return this.serverRole; + } + + /** + * Set registered Server serverRole. + * + * @param serverRole the serverRole value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerRole(String serverRole) { + this.serverRole = serverRole; + return this; + } + + /** + * Get registered Server clusterId. + * + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set registered Server clusterId. + * + * @param clusterId the clusterId value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get registered Server clusterName. + * + * @return the clusterName value + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set registered Server clusterName. + * + * @param clusterName the clusterName value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get registered Server serverId. + * + * @return the serverId value + */ + public String serverId() { + return this.serverId; + } + + /** + * Set registered Server serverId. + * + * @param serverId the serverId value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerId(String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Get registered Server storageSyncServiceUid. + * + * @return the storageSyncServiceUid value + */ + public String storageSyncServiceUid() { + return this.storageSyncServiceUid; + } + + /** + * Set registered Server storageSyncServiceUid. + * + * @param storageSyncServiceUid the storageSyncServiceUid value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withStorageSyncServiceUid(String storageSyncServiceUid) { + this.storageSyncServiceUid = storageSyncServiceUid; + return this; + } + + /** + * Get registered Server lastWorkflowId. + * + * @return the lastWorkflowId value + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Set registered Server lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastWorkflowId(String lastWorkflowId) { + this.lastWorkflowId = lastWorkflowId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersGetsInner.java new file mode 100644 index 00000000000..726d4547f29 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersGetsInner.java @@ -0,0 +1,153 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.RegisteredServersGetListByStorageSyncServiceHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RegisteredServersGets. + */ +public class RegisteredServersGetsInner { + /** The Retrofit service to perform REST calls. */ + private RegisteredServersGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of RegisteredServersGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegisteredServersGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(RegisteredServersGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RegisteredServersGets to be + * used by Retrofit to perform actually REST calls. + */ + interface RegisteredServersGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.RegisteredServersGets listByStorageSyncService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers") + Observable> listByStorageSyncService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<RegisteredServerInner> object if successful. + */ + public List listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @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> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RegisteredServerInner> object + */ + public Observable> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, RegisteredServersGetListByStorageSyncServiceHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, RegisteredServersGetListByStorageSyncServiceHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RegisteredServerInner> object + */ + public Observable, RegisteredServersGetListByStorageSyncServiceHeaders>> listByStorageSyncServiceWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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.listByStorageSyncService(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, RegisteredServersGetListByStorageSyncServiceHeaders>>>() { + @Override + public Observable, RegisteredServersGetListByStorageSyncServiceHeaders>> call(Response response) { + try { + ServiceResponse> result = listByStorageSyncServiceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, RegisteredServersGetListByStorageSyncServiceHeaders> listByStorageSyncServiceDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, RegisteredServersGetListByStorageSyncServiceHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersInner.java new file mode 100644 index 00000000000..de25ce4d605 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/RegisteredServersInner.java @@ -0,0 +1,628 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.RegisteredServersCreateHeaders; +import com.microsoft.azure.management.storagesync.RegisteredServersDeleteHeaders; +import com.microsoft.azure.management.storagesync.RegisteredServersGetHeaders; +import com.microsoft.azure.management.storagesync.RegisteredServersListByStorageSyncServiceHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RegisteredServers. + */ +public class RegisteredServersInner { + /** The Retrofit service to perform REST calls. */ + private RegisteredServersService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of RegisteredServersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegisteredServersInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(RegisteredServersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RegisteredServers to be + * used by Retrofit to perform actually REST calls. + */ + interface RegisteredServersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.RegisteredServers listByStorageSyncService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers") + Observable> listByStorageSyncService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @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.RegisteredServers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("serverId") String serverId, @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.RegisteredServers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("serverId") String serverId, @Query("api-version") String apiVersion, @Body RegisteredServerInner 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.RegisteredServers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("serverId") String serverId, @Query("api-version") String apiVersion, @Body RegisteredServerInner 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.RegisteredServers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("serverId") String serverId, @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.RegisteredServers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("serverId") String serverId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<RegisteredServerInner> object if successful. + */ + public List listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @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> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RegisteredServerInner> object + */ + public Observable> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, RegisteredServersListByStorageSyncServiceHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, RegisteredServersListByStorageSyncServiceHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RegisteredServerInner> object + */ + public Observable, RegisteredServersListByStorageSyncServiceHeaders>> listByStorageSyncServiceWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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.listByStorageSyncService(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, RegisteredServersListByStorageSyncServiceHeaders>>>() { + @Override + public Observable, RegisteredServersListByStorageSyncServiceHeaders>> call(Response response) { + try { + ServiceResponse> result = listByStorageSyncServiceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, RegisteredServersListByStorageSyncServiceHeaders> listByStorageSyncServiceDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, RegisteredServersListByStorageSyncServiceHeaders.class); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegisteredServerInner object if successful. + */ + public RegisteredServerInner get(String resourceGroupName, String storageSyncServiceName, String serverId) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).toBlocking().single().body(); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises 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 storageSyncServiceName, String serverId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId), serviceCallback); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegisteredServerInner object + */ + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).map(new Func1, RegisteredServerInner>() { + @Override + public RegisteredServerInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegisteredServerInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (serverId == null) { + throw new IllegalArgumentException("Parameter serverId 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(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(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, RegisteredServersGetHeaders.class); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegisteredServerInner object if successful. + */ + public RegisteredServerInner create(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).toBlocking().last().body(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @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 storageSyncServiceName, String serverId, RegisteredServerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters), serviceCallback); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).map(new Func1, RegisteredServerInner>() { + @Override + public RegisteredServerInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (serverId == null) { + throw new IllegalArgumentException("Parameter serverId 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), RegisteredServersCreateHeaders.class); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegisteredServerInner object if successful. + */ + public RegisteredServerInner beginCreate(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).toBlocking().single().body(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @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 storageSyncServiceName, String serverId, RegisteredServerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters), serviceCallback); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegisteredServerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).map(new Func1, RegisteredServerInner>() { + @Override + public RegisteredServerInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegisteredServerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId, RegisteredServerInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (serverId == null) { + throw new IllegalArgumentException("Parameter serverId 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(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, RegisteredServersCreateHeaders.class); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 delete(String resourceGroupName, String storageSyncServiceName, String serverId) { + deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).toBlocking().last().body(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises 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 deleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId), serviceCallback); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (serverId == null) { + throw new IllegalArgumentException("Parameter serverId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), RegisteredServersDeleteHeaders.class); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginDelete(String resourceGroupName, String storageSyncServiceName, String serverId) { + beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).toBlocking().single().body(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises 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 beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId), serviceCallback); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (serverId == null) { + throw new IllegalArgumentException("Parameter serverId 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.beginDelete(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, RegisteredServersDeleteHeaders.class); + } + +} 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 new file mode 100644 index 00000000000..700e53203f0 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointInner.java @@ -0,0 +1,543 @@ +/** + * 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 org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Server Endpoint object. + */ +@JsonFlatten +public class ServerEndpointInner extends ProxyResource { + /** + * Server Local path. + */ + @JsonProperty(value = "properties.serverLocalPath") + private String serverLocalPath; + + /** + * Cloud Tiering. Possible values include: 'on', 'off'. + */ + @JsonProperty(value = "properties.cloudTiering") + private String cloudTiering; + + /** + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "properties.volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /** + * Friendly Name. + */ + @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. + */ + @JsonProperty(value = "properties.serverResourceId") + private String serverResourceId; + + /** + * ServerEndpoint Provisioning State. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * ServerEndpoint lastWorkflowId. + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /** + * Get server Local path. + * + * @return the serverLocalPath value + */ + public String serverLocalPath() { + return this.serverLocalPath; + } + + /** + * Set server Local path. + * + * @param serverLocalPath the serverLocalPath value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withServerLocalPath(String serverLocalPath) { + this.serverLocalPath = serverLocalPath; + return this; + } + + /** + * Get cloud Tiering. Possible values include: 'on', 'off'. + * + * @return the cloudTiering value + */ + public String cloudTiering() { + return this.cloudTiering; + } + + /** + * Set cloud Tiering. Possible values include: 'on', 'off'. + * + * @param cloudTiering the cloudTiering value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withCloudTiering(String cloudTiering) { + this.cloudTiering = cloudTiering; + return this; + } + + /** + * Get level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @return the volumeFreeSpacePercent value + */ + public Integer volumeFreeSpacePercent() { + return this.volumeFreeSpacePercent; + } + + /** + * Set level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @param volumeFreeSpacePercent the volumeFreeSpacePercent value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get friendly Name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly Name. + * + * @param friendlyName the friendlyName value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withFriendlyName(String friendlyName) { + this.friendlyName = 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. + * + * @return the serverResourceId value + */ + public String serverResourceId() { + return this.serverResourceId; + } + + /** + * Set server Resource Id. + * + * @param serverResourceId the serverResourceId value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withServerResourceId(String serverResourceId) { + this.serverResourceId = serverResourceId; + return this; + } + + /** + * Get serverEndpoint Provisioning State. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set serverEndpoint Provisioning State. + * + * @param provisioningState the provisioningState value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get serverEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Set serverEndpoint lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withLastWorkflowId(String lastWorkflowId) { + this.lastWorkflowId = lastWorkflowId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointRecallsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointRecallsInner.java new file mode 100644 index 00000000000..971d7b600c3 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointRecallsInner.java @@ -0,0 +1,247 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.ServerEndpointRecallPostHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServerEndpointRecalls. + */ +public class ServerEndpointRecallsInner { + /** The Retrofit service to perform REST calls. */ + private ServerEndpointRecallsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of ServerEndpointRecallsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServerEndpointRecallsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(ServerEndpointRecallsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServerEndpointRecalls to be + * used by Retrofit to perform actually REST calls. + */ + interface ServerEndpointRecallsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpointRecalls post" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") + Observable> post(@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.ServerEndpointRecalls beginPost" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") + Observable> beginPost(@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); + + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().last().body(); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return postWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.post(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointRecallPostHeaders.class); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginPostWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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.beginPost(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) { + try { + ServiceResponseWithHeaders clientResponse = beginPostDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, ServerEndpointRecallPostHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsGetsInner.java new file mode 100644 index 00000000000..eac92e917b1 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsGetsInner.java @@ -0,0 +1,160 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.ServerEndpointsGetListBySyncGroupHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServerEndpointsGets. + */ +public class ServerEndpointsGetsInner { + /** The Retrofit service to perform REST calls. */ + private ServerEndpointsGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of ServerEndpointsGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServerEndpointsGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(ServerEndpointsGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServerEndpointsGets to be + * used by Retrofit to perform actually REST calls. + */ + interface ServerEndpointsGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpointsGets listBySyncGroup" }) + @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); + + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServerEndpointInner> object if successful. + */ + public List listBySyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerEndpointInner> object + */ + public Observable> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, ServerEndpointsGetListBySyncGroupHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, ServerEndpointsGetListBySyncGroupHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerEndpointInner> object + */ + public Observable, ServerEndpointsGetListBySyncGroupHeaders>> listBySyncGroupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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.listBySyncGroup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, ServerEndpointsGetListBySyncGroupHeaders>>>() { + @Override + public Observable, ServerEndpointsGetListBySyncGroupHeaders>> call(Response response) { + try { + ServiceResponse> result = listBySyncGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, ServerEndpointsGetListBySyncGroupHeaders> listBySyncGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, ServerEndpointsGetListBySyncGroupHeaders.class); + } + +} 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 new file mode 100644 index 00000000000..ebc7ed44694 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/ServerEndpointsInner.java @@ -0,0 +1,1242 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ServerEndpointsCreateHeaders; +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.ServerEndpointsUpdateHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ServerEndpoints. + */ +public class ServerEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private ServerEndpointsService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of ServerEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServerEndpointsInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(ServerEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServerEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface ServerEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}") + Observable> create(@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, @Body ServerEndpointInner 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.ServerEndpoints beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}") + Observable> beginCreate(@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, @Body ServerEndpointInner 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.ServerEndpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}") + Observable> update(@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, @Body ServerEndpointInner 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.ServerEndpoints beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}") + Observable> beginUpdate(@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, @Body ServerEndpointInner 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.ServerEndpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}") + Observable> get(@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 delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@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 beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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 listBySyncGroup" }) + @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" }) + @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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.ServerEndpoints beginRecall" }) + @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); + + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner create(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsCreateHeaders.class); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner beginCreate(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(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, ServerEndpointsCreateHeaders.class); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner update(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().last().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ServerEndpointInner parameters = null; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsUpdateHeaders.class); + } + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner update(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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.update(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsUpdateHeaders.class); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner beginUpdate(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 beginUpdateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ServerEndpointInner parameters = null; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner beginUpdate(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @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 beginUpdateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, ServerEndpointInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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.beginUpdate(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginUpdateDelegate(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, ServerEndpointsUpdateHeaders.class); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServerEndpointInner object if successful. + */ + public ServerEndpointInner get(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, ServerEndpointInner>() { + @Override + public ServerEndpointInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerEndpointInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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(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) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(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, ServerEndpointsGetHeaders.class); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 delete(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().last().body(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsDeleteHeaders.class); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginDelete(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toBlocking().single().body(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(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."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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.beginDelete(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) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(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, ServerEndpointsDeleteHeaders.class); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServerEndpointInner> object if successful. + */ + public List listBySyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerEndpointInner> object + */ + public Observable> listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return listBySyncGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, ServerEndpointsListBySyncGroupHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, ServerEndpointsListBySyncGroupHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerEndpointInner> object + */ + public Observable, ServerEndpointsListBySyncGroupHeaders>> listBySyncGroupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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.listBySyncGroup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, ServerEndpointsListBySyncGroupHeaders>>>() { + @Override + public Observable, ServerEndpointsListBySyncGroupHeaders>> call(Response response) { + try { + ServiceResponse> result = listBySyncGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, ServerEndpointsListBySyncGroupHeaders> listBySyncGroupDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, ServerEndpointsListBySyncGroupHeaders.class); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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(); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 recallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(recallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null."); + } + 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); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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(); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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 beginRecallAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginRecallWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName), serviceCallback); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a serverendpoint. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @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) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (serverEndpointName == null) { + throw new IllegalArgumentException("Parameter serverEndpointName 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.beginRecall(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) { + try { + ServiceResponseWithHeaders clientResponse = beginRecallDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginRecallDelegate(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); + } + +} 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 new file mode 100644 index 00000000000..1d0147f71d9 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * 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.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the StorageSyncManagementClientImpl class. + */ +public class StorageSyncManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public StorageSyncManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public StorageSyncManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public StorageSyncManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public StorageSyncManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + 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 StorageSyncServicesInner object to access its operations. + */ + private StorageSyncServicesInner storageSyncServices; + + /** + * Gets the StorageSyncServicesInner object to access its operations. + * @return the StorageSyncServicesInner object. + */ + public StorageSyncServicesInner storageSyncServices() { + return this.storageSyncServices; + } + + /** + * The SyncGroupsInner object to access its operations. + */ + private SyncGroupsInner syncGroups; + + /** + * Gets the SyncGroupsInner object to access its operations. + * @return the SyncGroupsInner object. + */ + public SyncGroupsInner syncGroups() { + return this.syncGroups; + } + + /** + * The CloudEndpointsInner object to access its operations. + */ + private CloudEndpointsInner cloudEndpoints; + + /** + * Gets the CloudEndpointsInner object to access its operations. + * @return the CloudEndpointsInner object. + */ + public CloudEndpointsInner cloudEndpoints() { + return this.cloudEndpoints; + } + + /** + * The ServerEndpointsInner object to access its operations. + */ + private ServerEndpointsInner serverEndpoints; + + /** + * Gets the ServerEndpointsInner object to access its operations. + * @return the ServerEndpointsInner object. + */ + public ServerEndpointsInner serverEndpoints() { + return this.serverEndpoints; + } + + /** + * The RegisteredServersInner object to access its operations. + */ + private RegisteredServersInner registeredServers; + + /** + * Gets the RegisteredServersInner object to access its operations. + * @return the RegisteredServersInner object. + */ + public RegisteredServersInner registeredServers() { + return this.registeredServers; + } + + /** + * The WorkflowsInner object to access its operations. + */ + private WorkflowsInner workflows; + + /** + * Gets the WorkflowsInner object to access its operations. + * @return the WorkflowsInner object. + */ + public WorkflowsInner workflows() { + return this.workflows; + } + + /** + * Initializes an instance of StorageSyncManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public StorageSyncManagementClientImpl(ServiceClientCredentials credentials) { + this("https://azure.microsoft.com", credentials); + } + + /** + * Initializes an instance of StorageSyncManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public StorageSyncManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of StorageSyncManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public StorageSyncManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-06-05-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.storageSyncServices = new StorageSyncServicesInner(restClient().retrofit(), this); + this.syncGroups = new SyncGroupsInner(restClient().retrofit(), this); + this.cloudEndpoints = new CloudEndpointsInner(restClient().retrofit(), this); + this.serverEndpoints = new ServerEndpointsInner(restClient().retrofit(), this); + this.registeredServers = new RegisteredServersInner(restClient().retrofit(), this); + this.workflows = new WorkflowsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "StorageSyncManagementClient", "2017-06-05-preview"); + } +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceByResourceGroupGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceByResourceGroupGetsInner.java new file mode 100644 index 00000000000..37ddb1ef8df --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceByResourceGroupGetsInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.StorageSyncServiceByResourceGroupGetListHeaders; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageSyncServiceByResourceGroupGets. + */ +public class StorageSyncServiceByResourceGroupGetsInner { + /** The Retrofit service to perform REST calls. */ + private StorageSyncServiceByResourceGroupGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of StorageSyncServiceByResourceGroupGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageSyncServiceByResourceGroupGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(StorageSyncServiceByResourceGroupGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageSyncServiceByResourceGroupGets to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageSyncServiceByResourceGroupGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServiceByResourceGroupGets listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1, StorageSyncServiceByResourceGroupGetListHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, StorageSyncServiceByResourceGroupGetListHeaders> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable, StorageSyncServiceByResourceGroupGetListHeaders>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, StorageSyncServiceByResourceGroupGetListHeaders>>>() { + @Override + public Observable, StorageSyncServiceByResourceGroupGetListHeaders>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, StorageSyncServiceByResourceGroupGetListHeaders> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, StorageSyncServiceByResourceGroupGetListHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceGetsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceGetsInner.java new file mode 100644 index 00000000000..45290df8d08 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceGetsInner.java @@ -0,0 +1,145 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.ErrorException; +import com.microsoft.azure.management.storagesync.StorageSyncServiceGetListBySubscriptionHeaders; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageSyncServiceGets. + */ +public class StorageSyncServiceGetsInner { + /** The Retrofit service to perform REST calls. */ + private StorageSyncServiceGetsService service; + /** The service client containing this operation class. */ + private MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of StorageSyncServiceGetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageSyncServiceGetsInner(Retrofit retrofit, MicrosoftStorageSyncImpl client) { + this.service = retrofit.create(StorageSyncServiceGetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageSyncServiceGets to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageSyncServiceGetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServiceGets list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get a StorageSyncService list by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1, StorageSyncServiceGetListBySubscriptionHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, StorageSyncServiceGetListBySubscriptionHeaders> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable, StorageSyncServiceGetListBySubscriptionHeaders>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, StorageSyncServiceGetListBySubscriptionHeaders>>>() { + @Override + public Observable, StorageSyncServiceGetListBySubscriptionHeaders>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, StorageSyncServiceGetListBySubscriptionHeaders> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, StorageSyncServiceGetListBySubscriptionHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceInner.java new file mode 100644 index 00000000000..1eca77364d0 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServiceInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Storage Sync Service object. + */ +@JsonFlatten +public class StorageSyncServiceInner extends TrackedResourceInner { + /** + * Storage Sync service status. + */ + @JsonProperty(value = "properties.storageSyncServiceStatus", access = JsonProperty.Access.WRITE_ONLY) + private Integer storageSyncServiceStatus; + + /** + * Storage Sync service Uid. + */ + @JsonProperty(value = "properties.storageSyncServiceUid", access = JsonProperty.Access.WRITE_ONLY) + private String storageSyncServiceUid; + + /** + * Get storage Sync service status. + * + * @return the storageSyncServiceStatus value + */ + public Integer storageSyncServiceStatus() { + return this.storageSyncServiceStatus; + } + + /** + * Get storage Sync service Uid. + * + * @return the storageSyncServiceUid value + */ + public String storageSyncServiceUid() { + return this.storageSyncServiceUid; + } + +} 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 new file mode 100644 index 00000000000..c897122bcf2 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/StorageSyncServicesInner.java @@ -0,0 +1,703 @@ +/** + * 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.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.StorageSyncServicesDeleteHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncServicesGetHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncServicesListByResourceGroupHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncServicesListBySubscriptionHeaders; +import com.microsoft.azure.management.storagesync.StorageSyncServicesUpdateHeaders; +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.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageSyncServices. + */ +public class StorageSyncServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private StorageSyncServicesService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of StorageSyncServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageSyncServicesInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(StorageSyncServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageSyncServices to be + * 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 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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @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.StorageSyncServices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}") + Observable> update(@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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.StorageSyncServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @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.StorageSyncServices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.StorageSyncServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageSyncServiceInner object if successful. + */ + public StorageSyncServiceInner create(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).toBlocking().single().body(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @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 storageSyncServiceName, StorageSyncServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters), serviceCallback); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).map(new Func1, StorageSyncServiceInner>() { + @Override + public StorageSyncServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .build(response); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageSyncServiceInner object if successful. + */ + public StorageSyncServiceInner getByResourceGroup(String resourceGroupName, String storageSyncServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String storageSyncServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, StorageSyncServiceInner>() { + @Override + public StorageSyncServiceInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getByResourceGroupDelegate(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, StorageSyncServicesGetHeaders.class); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageSyncServiceInner object if successful. + */ + public StorageSyncServiceInner update(String resourceGroupName, String storageSyncServiceName) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String storageSyncServiceName) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, StorageSyncServiceInner>() { + @Override + public StorageSyncServiceInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final StorageSyncServiceInner parameters = null; + return service.update(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageSyncServiceInner object if successful. + */ + public StorageSyncServiceInner update(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).toBlocking().single().body(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters), serviceCallback); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).map(new Func1, StorageSyncServiceInner>() { + @Override + public StorageSyncServiceInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageSyncServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, StorageSyncServiceInner parameters) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders updateDelegate(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, StorageSyncServicesUpdateHeaders.class); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 delete(String resourceGroupName, String storageSyncServiceName) { + deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @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 storageSyncServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String storageSyncServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders deleteDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, StorageSyncServicesDeleteHeaders.class); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1, StorageSyncServicesListByResourceGroupHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, StorageSyncServicesListByResourceGroupHeaders> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable, StorageSyncServicesListByResourceGroupHeaders>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, StorageSyncServicesListByResourceGroupHeaders>>>() { + @Override + public Observable, StorageSyncServicesListByResourceGroupHeaders>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, StorageSyncServicesListByResourceGroupHeaders> listByResourceGroupDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, StorageSyncServicesListByResourceGroupHeaders.class); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get a StorageSyncService list by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1, StorageSyncServicesListBySubscriptionHeaders>, Page>() { + @Override + public Page call(ServiceResponseWithHeaders, StorageSyncServicesListBySubscriptionHeaders> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @return the observable to the List<StorageSyncServiceInner> object + */ + public Observable, StorageSyncServicesListBySubscriptionHeaders>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, StorageSyncServicesListBySubscriptionHeaders>>>() { + @Override + public Observable, StorageSyncServicesListBySubscriptionHeaders>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, StorageSyncServicesListBySubscriptionHeaders> listDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, StorageSyncServicesListBySubscriptionHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupInner.java new file mode 100644 index 00000000000..87e5cc553dc --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupInner.java @@ -0,0 +1,61 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Sync Group object. + */ +@JsonFlatten +public class SyncGroupInner extends ProxyResource { + /** + * Unique Id. + */ + @JsonProperty(value = "properties.uniqueId") + private String uniqueId; + + /** + * Sync group status. + */ + @JsonProperty(value = "properties.syncGroupStatus", access = JsonProperty.Access.WRITE_ONLY) + private String syncGroupStatus; + + /** + * Get unique Id. + * + * @return the uniqueId value + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Set unique Id. + * + * @param uniqueId the uniqueId value to set + * @return the SyncGroupInner object itself. + */ + public SyncGroupInner withUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + return this; + } + + /** + * Get sync group status. + * + * @return the syncGroupStatus value + */ + public String syncGroupStatus() { + return this.syncGroupStatus; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupsInner.java new file mode 100644 index 00000000000..4904340a913 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/SyncGroupsInner.java @@ -0,0 +1,545 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.SyncGroupsCreateHeaders; +import com.microsoft.azure.management.storagesync.SyncGroupsDeleteHeaders; +import com.microsoft.azure.management.storagesync.SyncGroupsGetHeaders; +import com.microsoft.azure.management.storagesync.SyncGroupsListByStorageSyncServiceHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SyncGroups. + */ +public class SyncGroupsInner { + /** The Retrofit service to perform REST calls. */ + private SyncGroupsService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of SyncGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SyncGroupsInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(SyncGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SyncGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface SyncGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.SyncGroups listByStorageSyncService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups") + Observable> listByStorageSyncService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @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.SyncGroups create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}") + Observable> create(@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, @Body SyncGroupInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.SyncGroups get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}") + Observable> get(@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.SyncGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@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); + + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SyncGroupInner> object if successful. + */ + public List listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @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> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName), serviceCallback); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SyncGroupInner> object + */ + public Observable> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, SyncGroupsListByStorageSyncServiceHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, SyncGroupsListByStorageSyncServiceHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SyncGroupInner> object + */ + public Observable, SyncGroupsListByStorageSyncServiceHeaders>> listByStorageSyncServiceWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName 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.listByStorageSyncService(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable, SyncGroupsListByStorageSyncServiceHeaders>>>() { + @Override + public Observable, SyncGroupsListByStorageSyncServiceHeaders>> call(Response response) { + try { + ServiceResponse> result = listByStorageSyncServiceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, SyncGroupsListByStorageSyncServiceHeaders> listByStorageSyncServiceDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., StorageSyncErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, SyncGroupsListByStorageSyncServiceHeaders.class); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SyncGroupInner object if successful. + */ + public SyncGroupInner create(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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 storageSyncServiceName, String syncGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, SyncGroupInner>() { + @Override + public SyncGroupInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String uniqueId = null; + SyncGroupInner parameters = new SyncGroupInner(); + parameters.withUniqueId(null); + return service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param uniqueId Unique Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SyncGroupInner object if successful. + */ + public SyncGroupInner create(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String uniqueId) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, uniqueId).toBlocking().single().body(); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param uniqueId Unique Id + * @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 storageSyncServiceName, String syncGroupName, String uniqueId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, uniqueId), serviceCallback); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param uniqueId Unique Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String uniqueId) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, uniqueId).map(new Func1, SyncGroupInner>() { + @Override + public SyncGroupInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param uniqueId Unique Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String uniqueId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + SyncGroupInner parameters = new SyncGroupInner(); + parameters.withUniqueId(uniqueId); + return service.create(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders createDelegate(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, SyncGroupsCreateHeaders.class); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SyncGroupInner object if successful. + */ + public SyncGroupInner get(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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 storageSyncServiceName, String syncGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, SyncGroupInner>() { + @Override + public SyncGroupInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(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, SyncGroupsGetHeaders.class); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 delete(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toBlocking().single().body(); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @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 storageSyncServiceName, String syncGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName), serviceCallback); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (syncGroupName == null) { + throw new IllegalArgumentException("Parameter syncGroupName 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(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders deleteDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, SyncGroupsDeleteHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/TrackedResourceInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/TrackedResourceInner.java new file mode 100644 index 00000000000..6cdb7cfcf23 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/TrackedResourceInner.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.storagesync.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * ARM tracked resource. + */ +public class TrackedResourceInner extends ProxyResource { + /** + * The location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The tags of the resource. + */ + @JsonProperty(value = "tags") + private Object tags; + + /** + * Get the location of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the resource. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags of the resource. + * + * @return the tags value + */ + public Object tags() { + return this.tags; + } + + /** + * Set the tags of the resource. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Object tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowInner.java new file mode 100644 index 00000000000..f63d37d465b --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowInner.java @@ -0,0 +1,151 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Workflow resource. + */ +@JsonFlatten +public class WorkflowInner extends ProxyResource { + /** + * last step name. + */ + @JsonProperty(value = "properties.lastStepName") + private String lastStepName; + + /** + * workflow status. Possible values include: 'active', 'expired', + * 'succeeded', 'aborted', 'failed'. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * operation direction. Possible values include: 'do', 'undo', 'cancel'. + */ + @JsonProperty(value = "properties.operation") + private String operation; + + /** + * workflow steps. + */ + @JsonProperty(value = "properties.steps") + private String steps; + + /** + * workflow last operation identifier. + */ + @JsonProperty(value = "properties.lastOperationId") + private String lastOperationId; + + /** + * Get last step name. + * + * @return the lastStepName value + */ + public String lastStepName() { + return this.lastStepName; + } + + /** + * Set last step name. + * + * @param lastStepName the lastStepName value to set + * @return the WorkflowInner object itself. + */ + public WorkflowInner withLastStepName(String lastStepName) { + this.lastStepName = lastStepName; + return this; + } + + /** + * Get workflow status. Possible values include: 'active', 'expired', 'succeeded', 'aborted', 'failed'. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set workflow status. Possible values include: 'active', 'expired', 'succeeded', 'aborted', 'failed'. + * + * @param status the status value to set + * @return the WorkflowInner object itself. + */ + public WorkflowInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get operation direction. Possible values include: 'do', 'undo', 'cancel'. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation direction. Possible values include: 'do', 'undo', 'cancel'. + * + * @param operation the operation value to set + * @return the WorkflowInner object itself. + */ + public WorkflowInner withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get workflow steps. + * + * @return the steps value + */ + public String steps() { + return this.steps; + } + + /** + * Set workflow steps. + * + * @param steps the steps value to set + * @return the WorkflowInner object itself. + */ + public WorkflowInner withSteps(String steps) { + this.steps = steps; + return this; + } + + /** + * Get workflow last operation identifier. + * + * @return the lastOperationId value + */ + public String lastOperationId() { + return this.lastOperationId; + } + + /** + * Set workflow last operation identifier. + * + * @param lastOperationId the lastOperationId value to set + * @return the WorkflowInner object itself. + */ + public WorkflowInner withLastOperationId(String lastOperationId) { + this.lastOperationId = lastOperationId; + return this; + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowsInner.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowsInner.java new file mode 100644 index 00000000000..bd1c749cbbd --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/WorkflowsInner.java @@ -0,0 +1,252 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.WorkflowsAbortHeaders; +import com.microsoft.azure.management.storagesync.WorkflowsGetHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Workflows. + */ +public class WorkflowsInner { + /** The Retrofit service to perform REST calls. */ + private WorkflowsService service; + /** The service client containing this operation class. */ + private StorageSyncManagementClientImpl client; + + /** + * Initializes an instance of WorkflowsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkflowsInner(Retrofit retrofit, StorageSyncManagementClientImpl client) { + this.service = retrofit.create(WorkflowsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Workflows to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkflowsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.Workflows get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("workflowId") String workflowId, @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.Workflows abort" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort") + Observable> abort(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("workflowId") String workflowId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws StorageSyncErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkflowInner object if successful. + */ + public WorkflowInner get(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).toBlocking().single().body(); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @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 storageSyncServiceName, String workflowId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId), serviceCallback); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkflowInner object + */ + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return getWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).map(new Func1, WorkflowInner>() { + @Override + public WorkflowInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkflowInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (workflowId == null) { + throw new IllegalArgumentException("Parameter workflowId 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(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, workflowId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(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, WorkflowsGetHeaders.class); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 abort(String resourceGroupName, String storageSyncServiceName, String workflowId) { + abortWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).toBlocking().single().body(); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @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 abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(abortWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId), serviceCallback); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return abortWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, workflowId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> abortWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + 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 (storageSyncServiceName == null) { + throw new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null."); + } + if (workflowId == null) { + throw new IllegalArgumentException("Parameter workflowId 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.abort(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, workflowId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = abortDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders abortDelegate(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, WorkflowsAbortHeaders.class); + } + +} diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/package-info.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/package-info.java new file mode 100644 index 00000000000..a113bfc2f34 --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for StorageSyncManagementClient. + * Microsoft Storage Sync Service API. + */ +package com.microsoft.azure.management.storagesync.implementation; diff --git a/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/package-info.java b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/package-info.java new file mode 100644 index 00000000000..c88f2423d2f --- /dev/null +++ b/azure-mgmt-storagesync/src/main/java/com/microsoft/azure/management/storagesync/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for StorageSyncManagementClient. + * Microsoft Storage Sync Service API. + */ +package com.microsoft.azure.management.storagesync;