diff --git a/sdk/storagesync/mgmt-v2019_02_01/pom.xml b/sdk/storagesync/mgmt-v2019_02_01/pom.xml new file mode 100644 index 000000000000..4b5b57c4cac3 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.storagesync.v2019_02_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-storagesync + 1.0.0-beta + jar + Microsoft Azure SDK for StorageSync Management + This package contains Microsoft StorageSync Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/AzureEntityResource.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/AzureEntityResource.java new file mode 100644 index 000000000000..ef25459251c1 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/AzureEntityResource.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/BackupRequest.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/BackupRequest.java new file mode 100644 index 000000000000..9751dba302be --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..48048ca559e3 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityParameters.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for a check name availability request. + */ +public class CheckNameAvailabilityParameters { + /** + * The name to check for availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type. Must be set to + * Microsoft.StorageSync/storageSyncServices. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the name to check for availability. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.StorageSync/storageSyncServices"; + } + + /** + * Get the name to check for availability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name to check for availability. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityResult.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..1e0b4e4616f3 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + NameAvailabilityReason reason(); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoint.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoint.java new file mode 100644 index 000000000000..851e552a4caa --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoint.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.CloudEndpointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; + +/** + * Type representing CloudEndpoint. + */ +public interface CloudEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureFileShareName value. + */ + String azureFileShareName(); + + /** + * @return the backupEnabled value. + */ + String backupEnabled(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partnershipId value. + */ + String partnershipId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the storageAccountResourceId value. + */ + String storageAccountResourceId(); + + /** + * @return the storageAccountTenantId value. + */ + String storageAccountTenantId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CloudEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSyncGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of CloudEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CloudEndpoint definition. + */ + interface Blank extends WithSyncGroup { + } + + /** + * The stage of the cloudendpoint definition allowing to specify SyncGroup. + */ + interface WithSyncGroup { + /** + * Specifies resourceGroupName, storageSyncServiceName, syncGroupName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param storageSyncServiceName Name of Storage Sync Service resource + * @param syncGroupName Name of Sync Group resource + * @return the next definition stage + */ + WithCreate withExistingSyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + } + + /** + * The stage of the cloudendpoint definition allowing to specify AzureFileShareName. + */ + interface WithAzureFileShareName { + /** + * Specifies azureFileShareName. + * @param azureFileShareName Azure file share name + * @return the next definition stage + */ + WithCreate withAzureFileShareName(String azureFileShareName); + } + + /** + * The stage of the cloudendpoint definition allowing to specify StorageAccountResourceId. + */ + interface WithStorageAccountResourceId { + /** + * Specifies storageAccountResourceId. + * @param storageAccountResourceId Storage Account Resource Id + * @return the next definition stage + */ + WithCreate withStorageAccountResourceId(String storageAccountResourceId); + } + + /** + * The stage of the cloudendpoint definition allowing to specify StorageAccountTenantId. + */ + interface WithStorageAccountTenantId { + /** + * Specifies storageAccountTenantId. + * @param storageAccountTenantId Storage Account Tenant Id + * @return the next definition stage + */ + WithCreate withStorageAccountTenantId(String storageAccountTenantId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAzureFileShareName, DefinitionStages.WithStorageAccountResourceId, DefinitionStages.WithStorageAccountTenantId { + } + } + /** + * The template for a CloudEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureFileShareName, UpdateStages.WithStorageAccountResourceId, UpdateStages.WithStorageAccountTenantId { + } + + /** + * Grouping of CloudEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the cloudendpoint update allowing to specify AzureFileShareName. + */ + interface WithAzureFileShareName { + /** + * Specifies azureFileShareName. + * @param azureFileShareName Azure file share name + * @return the next update stage + */ + Update withAzureFileShareName(String azureFileShareName); + } + + /** + * The stage of the cloudendpoint update allowing to specify StorageAccountResourceId. + */ + interface WithStorageAccountResourceId { + /** + * Specifies storageAccountResourceId. + * @param storageAccountResourceId Storage Account Resource Id + * @return the next update stage + */ + Update withStorageAccountResourceId(String storageAccountResourceId); + } + + /** + * The stage of the cloudendpoint update allowing to specify StorageAccountTenantId. + */ + interface WithStorageAccountTenantId { + /** + * Specifies storageAccountTenantId. + * @param storageAccountTenantId Storage Account Tenant Id + * @return the next update stage + */ + Update withStorageAccountTenantId(String storageAccountTenantId); + } + + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointCreateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointCreateParameters.java new file mode 100644 index 000000000000..d83eed965095 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointCreateParameters.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The parameters used when creating a cloud endpoint. + */ +@JsonFlatten +public class CloudEndpointCreateParameters extends ProxyResource { + /** + * Storage Account Resource Id. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /** + * Azure file share name. + */ + @JsonProperty(value = "properties.azureFileShareName") + private String azureFileShareName; + + /** + * Storage Account Tenant Id. + */ + @JsonProperty(value = "properties.storageAccountTenantId") + private String storageAccountTenantId; + + /** + * 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 CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get azure file share name. + * + * @return the azureFileShareName value + */ + public String azureFileShareName() { + return this.azureFileShareName; + } + + /** + * Set azure file share name. + * + * @param azureFileShareName the azureFileShareName value to set + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withAzureFileShareName(String azureFileShareName) { + this.azureFileShareName = azureFileShareName; + 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 CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withStorageAccountTenantId(String storageAccountTenantId) { + this.storageAccountTenantId = storageAccountTenantId; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoints.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoints.java new file mode 100644 index 000000000000..aa6e73b36076 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpoints.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.CloudEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CloudEndpoints. + */ +public interface CloudEndpoints extends SupportsCreating, HasInner { + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Observable postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable preRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable postRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters); + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Observable listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsCreateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsCreateHeaders.java new file mode 100644 index 000000000000..b7f81377577c --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsDeleteHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsDeleteHeaders.java new file mode 100644 index 000000000000..a2c5f67d5d02 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsGetHeaders.java new file mode 100644 index 000000000000..3405bf3c0db6 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsListBySyncGroupHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsListBySyncGroupHeaders.java new file mode 100644 index 000000000000..83540c22238d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPostBackupHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPostBackupHeaders.java new file mode 100644 index 000000000000..ab3843143119 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPostRestoreHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPostRestoreHeaders.java new file mode 100644 index 000000000000..4d9fa119ed00 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPreBackupHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPreBackupHeaders.java new file mode 100644 index 000000000000..22cd38c3a0b5 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPreRestoreHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsPreRestoreHeaders.java new file mode 100644 index 000000000000..5d153d879fc4 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsRestoreheartbeatHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsRestoreheartbeatHeaders.java new file mode 100644 index 000000000000..86f8c488f587 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/CloudEndpointsRestoreheartbeatHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for restoreheartbeat operation. + */ +public class CloudEndpointsRestoreheartbeatHeaders { + /** + * request id. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /** + * correlation request id. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get request id. + * + * @return the xMsRequestId value + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set request id. + * + * @param xMsRequestId the xMsRequestId value to set + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get correlation request id. + * + * @return the xMsCorrelationRequestId value + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set correlation request id. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/FilesNotSyncingError.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/FilesNotSyncingError.java new file mode 100644 index 000000000000..a73241519404 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/FilesNotSyncingError.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Files not syncing error object. + */ +public class FilesNotSyncingError { + /** + * Error code (HResult). + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /** + * Count of persistent files not syncing with the specified error code. + */ + @JsonProperty(value = "persistentCount", access = JsonProperty.Access.WRITE_ONLY) + private Long persistentCount; + + /** + * Count of transient files not syncing with the specified error code. + */ + @JsonProperty(value = "transientCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transientCount; + + /** + * Get error code (HResult). + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get count of persistent files not syncing with the specified error code. + * + * @return the persistentCount value + */ + public Long persistentCount() { + return this.persistentCount; + } + + /** + * Get count of transient files not syncing with the specified error code. + * + * @return the transientCount value + */ + public Long transientCount() { + return this.transientCount; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/NameAvailabilityReason.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/NameAvailabilityReason.java new file mode 100644 index 000000000000..c81bc98b1d03 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/NameAvailabilityReason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NameAvailabilityReason. + */ +public enum NameAvailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a NameAvailabilityReason instance. */ + private String value; + + NameAvailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameAvailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameAvailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String value) { + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationDisplayInfo.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationDisplayInfo.java new file mode 100644 index 000000000000..e159a838fbec --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationDisplayResource.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationDisplayResource.java new file mode 100644 index 000000000000..3d1b101feea9 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationEntity.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationEntity.java new file mode 100644 index 000000000000..46e365a997b7 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationEntity.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.OperationEntityInner; + +/** + * Type representing OperationEntity. + */ +public interface OperationEntity extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayInfo display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Operations.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Operations.java new file mode 100644 index 000000000000..94800717d028 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationsListHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/OperationsListHeaders.java new file mode 100644 index 000000000000..b2460946069a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PostBackupResponse.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PostBackupResponse.java new file mode 100644 index 000000000000..eb31811ba908 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PostBackupResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.PostBackupResponseInner; + +/** + * Type representing PostBackupResponse. + */ +public interface PostBackupResponse extends HasInner, HasManager { + /** + * @return the cloudEndpointName value. + */ + String cloudEndpointName(); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PostRestoreRequest.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PostRestoreRequest.java new file mode 100644 index 000000000000..c297370d61c4 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PreRestoreRequest.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/PreRestoreRequest.java new file mode 100644 index 000000000000..48f574b2e7cc --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Reason.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Reason.java new file mode 100644 index 000000000000..2208651a735a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RecallActionParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RecallActionParameters.java new file mode 100644 index 000000000000..64dac9243b31 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RecallActionParameters.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used when calling recall action on server endpoint. + */ +public class RecallActionParameters { + /** + * Pattern of the files. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /** + * Recall path. + */ + @JsonProperty(value = "recallPath") + private String recallPath; + + /** + * Get pattern of the files. + * + * @return the pattern value + */ + public String pattern() { + return this.pattern; + } + + /** + * Set pattern of the files. + * + * @param pattern the pattern value to set + * @return the RecallActionParameters object itself. + */ + public RecallActionParameters withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get recall path. + * + * @return the recallPath value + */ + public String recallPath() { + return this.recallPath; + } + + /** + * Set recall path. + * + * @param recallPath the recallPath value to set + * @return the RecallActionParameters object itself. + */ + public RecallActionParameters withRecallPath(String recallPath) { + this.recallPath = recallPath; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServer.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServer.java new file mode 100644 index 000000000000..aae49cbc9ab2 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServer.java @@ -0,0 +1,399 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.RegisteredServerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; + +/** + * Type representing RegisteredServer. + */ +public interface RegisteredServer extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the clusterId value. + */ + String clusterId(); + + /** + * @return the clusterName value. + */ + String clusterName(); + + /** + * @return the discoveryEndpointUri value. + */ + String discoveryEndpointUri(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastHeartBeat value. + */ + String lastHeartBeat(); + + /** + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * @return the managementEndpointUri value. + */ + String managementEndpointUri(); + + /** + * @return the monitoringConfiguration value. + */ + String monitoringConfiguration(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceLocation value. + */ + String resourceLocation(); + + /** + * @return the serverCertificate value. + */ + String serverCertificate(); + + /** + * @return the serverId value. + */ + String serverId(); + + /** + * @return the serverManagementErrorCode value. + */ + Integer serverManagementErrorCode(); + + /** + * @return the serverOSVersion value. + */ + String serverOSVersion(); + + /** + * @return the serverRole value. + */ + String serverRole(); + + /** + * @return the serviceLocation value. + */ + String serviceLocation(); + + /** + * @return the storageSyncServiceUid value. + */ + String storageSyncServiceUid(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the RegisteredServer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageSyncService, DefinitionStages.WithCreate { + } + + /** + * Grouping of RegisteredServer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RegisteredServer definition. + */ + interface Blank extends WithStorageSyncService { + } + + /** + * The stage of the registeredserver definition allowing to specify StorageSyncService. + */ + interface WithStorageSyncService { + /** + * Specifies resourceGroupName, storageSyncServiceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param storageSyncServiceName Name of Storage Sync Service resource + * @return the next definition stage + */ + WithCreate withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName); + } + + /** + * The stage of the registeredserver definition allowing to specify AgentVersion. + */ + interface WithAgentVersion { + /** + * Specifies agentVersion. + * @param agentVersion Registered Server Agent Version + * @return the next definition stage + */ + WithCreate withAgentVersion(String agentVersion); + } + + /** + * The stage of the registeredserver definition allowing to specify ClusterId. + */ + interface WithClusterId { + /** + * Specifies clusterId. + * @param clusterId Registered Server clusterId + * @return the next definition stage + */ + WithCreate withClusterId(String clusterId); + } + + /** + * The stage of the registeredserver definition allowing to specify ClusterName. + */ + interface WithClusterName { + /** + * Specifies clusterName. + * @param clusterName Registered Server clusterName + * @return the next definition stage + */ + WithCreate withClusterName(String clusterName); + } + + /** + * The stage of the registeredserver definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly Name + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * The stage of the registeredserver definition allowing to specify LastHeartBeat. + */ + interface WithLastHeartBeat { + /** + * Specifies lastHeartBeat. + * @param lastHeartBeat Registered Server last heart beat + * @return the next definition stage + */ + WithCreate withLastHeartBeat(String lastHeartBeat); + } + + /** + * The stage of the registeredserver definition allowing to specify ServerCertificate. + */ + interface WithServerCertificate { + /** + * Specifies serverCertificate. + * @param serverCertificate Registered Server Certificate + * @return the next definition stage + */ + WithCreate withServerCertificate(String serverCertificate); + } + + /** + * The stage of the registeredserver definition allowing to specify ServerId. + */ + interface WithServerId { + /** + * Specifies serverId. + * @param serverId Registered Server serverId + * @return the next definition stage + */ + WithCreate withServerId(String serverId); + } + + /** + * The stage of the registeredserver definition allowing to specify ServerOSVersion. + */ + interface WithServerOSVersion { + /** + * Specifies serverOSVersion. + * @param serverOSVersion Registered Server OS Version + * @return the next definition stage + */ + WithCreate withServerOSVersion(String serverOSVersion); + } + + /** + * The stage of the registeredserver definition allowing to specify ServerRole. + */ + interface WithServerRole { + /** + * Specifies serverRole. + * @param serverRole Registered Server serverRole + * @return the next definition stage + */ + WithCreate withServerRole(String serverRole); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAgentVersion, DefinitionStages.WithClusterId, DefinitionStages.WithClusterName, DefinitionStages.WithFriendlyName, DefinitionStages.WithLastHeartBeat, DefinitionStages.WithServerCertificate, DefinitionStages.WithServerId, DefinitionStages.WithServerOSVersion, DefinitionStages.WithServerRole { + } + } + /** + * The template for a RegisteredServer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAgentVersion, UpdateStages.WithClusterId, UpdateStages.WithClusterName, UpdateStages.WithFriendlyName, UpdateStages.WithLastHeartBeat, UpdateStages.WithServerCertificate, UpdateStages.WithServerId, UpdateStages.WithServerOSVersion, UpdateStages.WithServerRole { + } + + /** + * Grouping of RegisteredServer update stages. + */ + interface UpdateStages { + /** + * The stage of the registeredserver update allowing to specify AgentVersion. + */ + interface WithAgentVersion { + /** + * Specifies agentVersion. + * @param agentVersion Registered Server Agent Version + * @return the next update stage + */ + Update withAgentVersion(String agentVersion); + } + + /** + * The stage of the registeredserver update allowing to specify ClusterId. + */ + interface WithClusterId { + /** + * Specifies clusterId. + * @param clusterId Registered Server clusterId + * @return the next update stage + */ + Update withClusterId(String clusterId); + } + + /** + * The stage of the registeredserver update allowing to specify ClusterName. + */ + interface WithClusterName { + /** + * Specifies clusterName. + * @param clusterName Registered Server clusterName + * @return the next update stage + */ + Update withClusterName(String clusterName); + } + + /** + * The stage of the registeredserver update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly Name + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + /** + * The stage of the registeredserver update allowing to specify LastHeartBeat. + */ + interface WithLastHeartBeat { + /** + * Specifies lastHeartBeat. + * @param lastHeartBeat Registered Server last heart beat + * @return the next update stage + */ + Update withLastHeartBeat(String lastHeartBeat); + } + + /** + * The stage of the registeredserver update allowing to specify ServerCertificate. + */ + interface WithServerCertificate { + /** + * Specifies serverCertificate. + * @param serverCertificate Registered Server Certificate + * @return the next update stage + */ + Update withServerCertificate(String serverCertificate); + } + + /** + * The stage of the registeredserver update allowing to specify ServerId. + */ + interface WithServerId { + /** + * Specifies serverId. + * @param serverId Registered Server serverId + * @return the next update stage + */ + Update withServerId(String serverId); + } + + /** + * The stage of the registeredserver update allowing to specify ServerOSVersion. + */ + interface WithServerOSVersion { + /** + * Specifies serverOSVersion. + * @param serverOSVersion Registered Server OS Version + * @return the next update stage + */ + Update withServerOSVersion(String serverOSVersion); + } + + /** + * The stage of the registeredserver update allowing to specify ServerRole. + */ + interface WithServerRole { + /** + * Specifies serverRole. + * @param serverRole Registered Server serverRole + * @return the next update stage + */ + Update withServerRole(String serverRole); + } + + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServerCreateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServerCreateParameters.java new file mode 100644 index 000000000000..9547c03aac01 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServerCreateParameters.java @@ -0,0 +1,254 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The parameters used when creating a registered server. + */ +@JsonFlatten +public class RegisteredServerCreateParameters extends ProxyResource { + /** + * 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 last heart beat. + */ + @JsonProperty(value = "properties.lastHeartBeat") + private String lastHeartBeat; + + /** + * 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; + + /** + * Friendly Name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerOSVersion(String serverOSVersion) { + this.serverOSVersion = serverOSVersion; + 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withLastHeartBeat(String lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerId(String serverId) { + this.serverId = serverId; + 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 RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServers.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServers.java new file mode 100644 index 000000000000..ececa50c9297 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServers.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.RegisteredServersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RegisteredServers. + */ +public interface RegisteredServers extends SupportsCreating, HasInner { + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId); + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Observable getAsync(String resourceGroupName, String storageSyncServiceName, String serverId); + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersCreateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersCreateHeaders.java new file mode 100644 index 000000000000..8912cabca2f4 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersDeleteHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersDeleteHeaders.java new file mode 100644 index 000000000000..c9f79aea5e7b --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersGetHeaders.java new file mode 100644 index 000000000000..48b2859ffb88 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersListByStorageSyncServiceHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersListByStorageSyncServiceHeaders.java new file mode 100644 index 000000000000..4ef7aa86972d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersTriggerRolloverHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersTriggerRolloverHeaders.java new file mode 100644 index 000000000000..e935aabddc8f --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RegisteredServersTriggerRolloverHeaders.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for triggerRollover operation. + */ +public class RegisteredServersTriggerRolloverHeaders { + /** + * 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 RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders 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 RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders 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 RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ResourcesMoveInfo.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ResourcesMoveInfo.java new file mode 100644 index 000000000000..8c25798b61cf --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RestoreFileSpec.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/RestoreFileSpec.java new file mode 100644 index 000000000000..87e30d76ae2f --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoint.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoint.java new file mode 100644 index 000000000000..2b9737be6c80 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoint.java @@ -0,0 +1,315 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.ServerEndpointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; + +/** + * Type representing ServerEndpoint. + */ +public interface ServerEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cloudTiering value. + */ + String cloudTiering(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the offlineDataTransfer value. + */ + String offlineDataTransfer(); + + /** + * @return the offlineDataTransferShareName value. + */ + String offlineDataTransferShareName(); + + /** + * @return the offlineDataTransferStorageAccountResourceId value. + */ + String offlineDataTransferStorageAccountResourceId(); + + /** + * @return the offlineDataTransferStorageAccountTenantId value. + */ + String offlineDataTransferStorageAccountTenantId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serverLocalPath value. + */ + String serverLocalPath(); + + /** + * @return the serverResourceId value. + */ + String serverResourceId(); + + /** + * @return the syncStatus value. + */ + ServerEndpointSyncStatus syncStatus(); + + /** + * @return the tierFilesOlderThanDays value. + */ + Integer tierFilesOlderThanDays(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the volumeFreeSpacePercent value. + */ + Integer volumeFreeSpacePercent(); + + /** + * The entirety of the ServerEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSyncGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServerEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServerEndpoint definition. + */ + interface Blank extends WithSyncGroup { + } + + /** + * The stage of the serverendpoint definition allowing to specify SyncGroup. + */ + interface WithSyncGroup { + /** + * Specifies resourceGroupName, storageSyncServiceName, syncGroupName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param storageSyncServiceName Name of Storage Sync Service resource + * @param syncGroupName Name of Sync Group resource + * @return the next definition stage + */ + WithCreate withExistingSyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + } + + /** + * The stage of the serverendpoint definition allowing to specify CloudTiering. + */ + interface WithCloudTiering { + /** + * Specifies cloudTiering. + * @param cloudTiering Cloud Tiering. Possible values include: 'on', 'off' + * @return the next definition stage + */ + WithCreate withCloudTiering(String cloudTiering); + } + + /** + * The stage of the serverendpoint definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly Name + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * The stage of the serverendpoint definition allowing to specify OfflineDataTransfer. + */ + interface WithOfflineDataTransfer { + /** + * Specifies offlineDataTransfer. + * @param offlineDataTransfer Offline data transfer. Possible values include: 'on', 'off' + * @return the next definition stage + */ + WithCreate withOfflineDataTransfer(String offlineDataTransfer); + } + + /** + * The stage of the serverendpoint definition allowing to specify OfflineDataTransferShareName. + */ + interface WithOfflineDataTransferShareName { + /** + * Specifies offlineDataTransferShareName. + * @param offlineDataTransferShareName Offline data transfer share name + * @return the next definition stage + */ + WithCreate withOfflineDataTransferShareName(String offlineDataTransferShareName); + } + + /** + * The stage of the serverendpoint definition allowing to specify ServerLocalPath. + */ + interface WithServerLocalPath { + /** + * Specifies serverLocalPath. + * @param serverLocalPath Server Local path + * @return the next definition stage + */ + WithCreate withServerLocalPath(String serverLocalPath); + } + + /** + * The stage of the serverendpoint definition allowing to specify ServerResourceId. + */ + interface WithServerResourceId { + /** + * Specifies serverResourceId. + * @param serverResourceId Server Resource Id + * @return the next definition stage + */ + WithCreate withServerResourceId(String serverResourceId); + } + + /** + * The stage of the serverendpoint definition allowing to specify TierFilesOlderThanDays. + */ + interface WithTierFilesOlderThanDays { + /** + * Specifies tierFilesOlderThanDays. + * @param tierFilesOlderThanDays Tier files older than days + * @return the next definition stage + */ + WithCreate withTierFilesOlderThanDays(Integer tierFilesOlderThanDays); + } + + /** + * The stage of the serverendpoint definition allowing to specify VolumeFreeSpacePercent. + */ + interface WithVolumeFreeSpacePercent { + /** + * Specifies volumeFreeSpacePercent. + * @param volumeFreeSpacePercent Level of free space to be maintained by Cloud Tiering if it is enabled + * @return the next definition stage + */ + WithCreate withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCloudTiering, DefinitionStages.WithFriendlyName, DefinitionStages.WithOfflineDataTransfer, DefinitionStages.WithOfflineDataTransferShareName, DefinitionStages.WithServerLocalPath, DefinitionStages.WithServerResourceId, DefinitionStages.WithTierFilesOlderThanDays, DefinitionStages.WithVolumeFreeSpacePercent { + } + } + /** + * The template for a ServerEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCloudTiering, UpdateStages.WithOfflineDataTransfer, UpdateStages.WithOfflineDataTransferShareName, UpdateStages.WithTierFilesOlderThanDays, UpdateStages.WithVolumeFreeSpacePercent { + } + + /** + * Grouping of ServerEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the serverendpoint update allowing to specify CloudTiering. + */ + interface WithCloudTiering { + /** + * Specifies cloudTiering. + * @param cloudTiering Cloud Tiering. Possible values include: 'on', 'off' + * @return the next update stage + */ + Update withCloudTiering(String cloudTiering); + } + + /** + * The stage of the serverendpoint update allowing to specify OfflineDataTransfer. + */ + interface WithOfflineDataTransfer { + /** + * Specifies offlineDataTransfer. + * @param offlineDataTransfer Offline data transfer. Possible values include: 'on', 'off' + * @return the next update stage + */ + Update withOfflineDataTransfer(String offlineDataTransfer); + } + + /** + * The stage of the serverendpoint update allowing to specify OfflineDataTransferShareName. + */ + interface WithOfflineDataTransferShareName { + /** + * Specifies offlineDataTransferShareName. + * @param offlineDataTransferShareName Offline data transfer share name + * @return the next update stage + */ + Update withOfflineDataTransferShareName(String offlineDataTransferShareName); + } + + /** + * The stage of the serverendpoint update allowing to specify TierFilesOlderThanDays. + */ + interface WithTierFilesOlderThanDays { + /** + * Specifies tierFilesOlderThanDays. + * @param tierFilesOlderThanDays Tier files older than days + * @return the next update stage + */ + Update withTierFilesOlderThanDays(Integer tierFilesOlderThanDays); + } + + /** + * The stage of the serverendpoint update allowing to specify VolumeFreeSpacePercent. + */ + interface WithVolumeFreeSpacePercent { + /** + * Specifies volumeFreeSpacePercent. + * @param volumeFreeSpacePercent Level of free space to be maintained by Cloud Tiering if it is enabled + * @return the next update stage + */ + Update withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent); + } + + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointCreateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointCreateParameters.java new file mode 100644 index 000000000000..d9d679a7a2ba --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointCreateParameters.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The parameters used when creating a server endpoint. + */ +@JsonFlatten +public class ServerEndpointCreateParameters 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; + + /** + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /** + * Friendly Name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Server Resource Id. + */ + @JsonProperty(value = "properties.serverResourceId") + private String serverResourceId; + + /** + * Offline data transfer. Possible values include: 'on', 'off'. + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private String offlineDataTransfer; + + /** + * Offline data transfer share name. + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /** + * 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 ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters 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 ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters 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 ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get tier files older than days. + * + * @return the tierFilesOlderThanDays value + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + 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 ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + 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 ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withServerResourceId(String serverResourceId) { + this.serverResourceId = serverResourceId; + return this; + } + + /** + * Get offline data transfer. Possible values include: 'on', 'off'. + * + * @return the offlineDataTransfer value + */ + public String offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set offline data transfer. Possible values include: 'on', 'off'. + * + * @param offlineDataTransfer the offlineDataTransfer value to set + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withOfflineDataTransfer(String offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get offline data transfer share name. + * + * @return the offlineDataTransferShareName value + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointSyncStatus.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointSyncStatus.java new file mode 100644 index 000000000000..21205dcdd86d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointSyncStatus.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Server Endpoint sync status. + */ +public class ServerEndpointSyncStatus { + /** + * Download Health Status. Possible values include: 'Healthy', 'Error', + * 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', + * 'NoActivity'. + */ + @JsonProperty(value = "downloadHealth", access = JsonProperty.Access.WRITE_ONLY) + private String downloadHealth; + + /** + * Upload Health Status. Possible values include: 'Healthy', 'Error', + * 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', + * 'NoActivity'. + */ + @JsonProperty(value = "uploadHealth", access = JsonProperty.Access.WRITE_ONLY) + private String uploadHealth; + + /** + * Combined Health Status. Possible values include: 'Healthy', 'Error', + * 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', + * 'NoActivity'. + */ + @JsonProperty(value = "combinedHealth", access = JsonProperty.Access.WRITE_ONLY) + private String combinedHealth; + + /** + * Sync activity. Possible values include: 'Upload', 'Download', + * 'UploadAndDownload'. + */ + @JsonProperty(value = "syncActivity", access = JsonProperty.Access.WRITE_ONLY) + private String syncActivity; + + /** + * Total count of persistent files not syncing (combined upload + + * download). Reserved for future use. + */ + @JsonProperty(value = "totalPersistentFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalPersistentFilesNotSyncingCount; + + /** + * Last Updated Timestamp. + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdatedTimestamp; + + /** + * Upload Status. + */ + @JsonProperty(value = "uploadStatus", access = JsonProperty.Access.WRITE_ONLY) + private SyncSessionStatus uploadStatus; + + /** + * Download Status. + */ + @JsonProperty(value = "downloadStatus", access = JsonProperty.Access.WRITE_ONLY) + private SyncSessionStatus downloadStatus; + + /** + * Upload sync activity. + */ + @JsonProperty(value = "uploadActivity", access = JsonProperty.Access.WRITE_ONLY) + private SyncActivityStatus uploadActivity; + + /** + * Download sync activity. + */ + @JsonProperty(value = "downloadActivity", access = JsonProperty.Access.WRITE_ONLY) + private SyncActivityStatus downloadActivity; + + /** + * Offline Data Transfer State. Possible values include: 'InProgress', + * 'Stopping', 'NotRunning', 'Complete'. + */ + @JsonProperty(value = "offlineDataTransferStatus", access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStatus; + + /** + * Get download Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + * + * @return the downloadHealth value + */ + public String downloadHealth() { + return this.downloadHealth; + } + + /** + * Get upload Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + * + * @return the uploadHealth value + */ + public String uploadHealth() { + return this.uploadHealth; + } + + /** + * Get combined Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity'. + * + * @return the combinedHealth value + */ + public String combinedHealth() { + return this.combinedHealth; + } + + /** + * Get sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload'. + * + * @return the syncActivity value + */ + public String syncActivity() { + return this.syncActivity; + } + + /** + * Get total count of persistent files not syncing (combined upload + download). Reserved for future use. + * + * @return the totalPersistentFilesNotSyncingCount value + */ + public Long totalPersistentFilesNotSyncingCount() { + return this.totalPersistentFilesNotSyncingCount; + } + + /** + * Get last Updated Timestamp. + * + * @return the lastUpdatedTimestamp value + */ + public DateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get upload Status. + * + * @return the uploadStatus value + */ + public SyncSessionStatus uploadStatus() { + return this.uploadStatus; + } + + /** + * Get download Status. + * + * @return the downloadStatus value + */ + public SyncSessionStatus downloadStatus() { + return this.downloadStatus; + } + + /** + * Get upload sync activity. + * + * @return the uploadActivity value + */ + public SyncActivityStatus uploadActivity() { + return this.uploadActivity; + } + + /** + * Get download sync activity. + * + * @return the downloadActivity value + */ + public SyncActivityStatus downloadActivity() { + return this.downloadActivity; + } + + /** + * Get offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete'. + * + * @return the offlineDataTransferStatus value + */ + public String offlineDataTransferStatus() { + return this.offlineDataTransferStatus; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointUpdateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointUpdateParameters.java new file mode 100644 index 000000000000..c22919170c43 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointUpdateParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters for updating an Server Endpoint. + */ +@JsonFlatten +public class ServerEndpointUpdateParameters { + /** + * 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; + + /** + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /** + * Offline data transfer. Possible values include: 'on', 'off'. + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private String offlineDataTransfer; + + /** + * Offline data transfer share name. + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /** + * 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 ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters 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 ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get tier files older than days. + * + * @return the tierFilesOlderThanDays value + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + return this; + } + + /** + * Get offline data transfer. Possible values include: 'on', 'off'. + * + * @return the offlineDataTransfer value + */ + public String offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set offline data transfer. Possible values include: 'on', 'off'. + * + * @param offlineDataTransfer the offlineDataTransfer value to set + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withOfflineDataTransfer(String offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get offline data transfer share name. + * + * @return the offlineDataTransferShareName value + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoints.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoints.java new file mode 100644 index 000000000000..761feba97996 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpoints.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.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.ServerEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServerEndpoints. + */ +public interface ServerEndpoints extends SupportsCreating, HasInner { + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters); + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Observable listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 + */ + Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsCreateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsCreateHeaders.java new file mode 100644 index 000000000000..29995be300e9 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsDeleteHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsDeleteHeaders.java new file mode 100644 index 000000000000..2bf78a45f9a1 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsGetHeaders.java new file mode 100644 index 000000000000..274ddcf57099 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsListBySyncGroupHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsListBySyncGroupHeaders.java new file mode 100644 index 000000000000..09784b6dca5b --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsRecallActionHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsRecallActionHeaders.java new file mode 100644 index 000000000000..585d844b3298 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsRecallActionHeaders.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for recallAction operation. + */ +public class ServerEndpointsRecallActionHeaders { + /** + * request id. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /** + * correlation request id. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Operation Status Location URI. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get request id. + * + * @return the xMsRequestId value + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set request id. + * + * @param xMsRequestId the xMsRequestId value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get correlation request id. + * + * @return the xMsCorrelationRequestId value + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set correlation request id. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get operation Status Location URI. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set operation Status Location URI. + * + * @param location the location value to set + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsUpdateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/ServerEndpointsUpdateHeaders.java new file mode 100644 index 000000000000..190e7332b62a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncApiError.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncApiError.java new file mode 100644 index 000000000000..7107eb344230 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncApiError.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error type. + */ +public class StorageSyncApiError { + /** + * 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 error entry. + */ + @JsonProperty(value = "target") + private String target; + + /** + * 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 StorageSyncApiError object itself. + */ + public StorageSyncApiError 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 StorageSyncApiError object itself. + */ + public StorageSyncApiError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get target of the given error entry. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set target of the given error entry. + * + * @param target the target value to set + * @return the StorageSyncApiError object itself. + */ + public StorageSyncApiError withTarget(String target) { + this.target = target; + 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 StorageSyncApiError object itself. + */ + public StorageSyncApiError withDetails(StorageSyncErrorDetails details) { + this.details = details; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncError.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncError.java new file mode 100644 index 000000000000..7b56ead41a46 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncError.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error type. + */ +public class StorageSyncError { + /** + * Error details of the given entry. + */ + @JsonProperty(value = "error") + private StorageSyncApiError error; + + /** + * Error details of the given entry. + */ + @JsonProperty(value = "innererror") + private StorageSyncApiError innererror; + + /** + * Get error details of the given entry. + * + * @return the error value + */ + public StorageSyncApiError error() { + return this.error; + } + + /** + * Set error details of the given entry. + * + * @param error the error value to set + * @return the StorageSyncError object itself. + */ + public StorageSyncError withError(StorageSyncApiError error) { + this.error = error; + return this; + } + + /** + * Get error details of the given entry. + * + * @return the innererror value + */ + public StorageSyncApiError innererror() { + return this.innererror; + } + + /** + * Set error details of the given entry. + * + * @param innererror the innererror value to set + * @return the StorageSyncError object itself. + */ + public StorageSyncError withInnererror(StorageSyncApiError innererror) { + this.innererror = innererror; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncErrorDetails.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncErrorDetails.java new file mode 100644 index 000000000000..194ca3ded670 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncErrorException.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncErrorException.java new file mode 100644 index 000000000000..6b0d6f0ec038 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncService.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncService.java new file mode 100644 index 000000000000..30fc35b016fc --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncService.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncServiceInner; + +/** + * Type representing StorageSyncService. + */ +public interface StorageSyncService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the storageSyncServiceStatus value. + */ + Integer storageSyncServiceStatus(); + + /** + * @return the storageSyncServiceUid value. + */ + String storageSyncServiceUid(); + + /** + * The entirety of the StorageSyncService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageSyncService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageSyncService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the StorageSyncService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the storagesyncservice definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next definition stage + */ + WithCreate withProperties(Object properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProperties { + } + } + /** + * The template for a StorageSyncService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of StorageSyncService update stages. + */ + interface UpdateStages { + /** + * The stage of the storagesyncservice update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the storage sync service + * @return the next update stage + */ + Update withProperties(Object properties); + } + + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceCreateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceCreateParameters.java new file mode 100644 index 000000000000..07b0e414fd21 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceCreateParameters.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used when creating a storage sync service. + */ +public class StorageSyncServiceCreateParameters { + /** + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update, the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key with a length no greater than 128 characters and a value + * with a length no greater than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @param location the location value to set + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @param tags the tags value to set + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceUpdateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceUpdateParameters.java new file mode 100644 index 000000000000..e0bc18a1db0b --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServiceUpdateParameters.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.v2019_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating an Storage sync service. + */ +public class StorageSyncServiceUpdateParameters { + /** + * The user-specified tags associated with the storage sync service. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the storage sync service. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the user-specified tags associated with the storage sync service. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the user-specified tags associated with the storage sync service. + * + * @param tags the tags value to set + * @return the StorageSyncServiceUpdateParameters object itself. + */ + public StorageSyncServiceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the storage sync service. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties of the storage sync service. + * + * @param properties the properties value to set + * @return the StorageSyncServiceUpdateParameters object itself. + */ + public StorageSyncServiceUpdateParameters withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServices.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServices.java new file mode 100644 index 000000000000..7dd65d006d0c --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServices.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageSyncServices. + */ +public interface StorageSyncServices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String locationName, String name); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesDeleteHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesDeleteHeaders.java new file mode 100644 index 000000000000..c06ced832eaf --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesGetHeaders.java new file mode 100644 index 000000000000..1d85158c7186 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesListByResourceGroupHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesListByResourceGroupHeaders.java new file mode 100644 index 000000000000..56d242e1bf81 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesListBySubscriptionHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesListBySubscriptionHeaders.java new file mode 100644 index 000000000000..9fa866370ab0 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesUpdateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/StorageSyncServicesUpdateHeaders.java new file mode 100644 index 000000000000..fd24a42b2c9a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SubscriptionState.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SubscriptionState.java new file mode 100644 index 000000000000..43cf6582bcdf --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncActivityStatus.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncActivityStatus.java new file mode 100644 index 000000000000..3ea44d9905c4 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncActivityStatus.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sync Session status object. + */ +public class SyncActivityStatus { + /** + * Timestamp when properties were updated. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Per item error count. + */ + @JsonProperty(value = "perItemErrorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long perItemErrorCount; + + /** + * Applied item count. + */ + @JsonProperty(value = "appliedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedItemCount; + + /** + * Total item count (if available). + */ + @JsonProperty(value = "totalItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalItemCount; + + /** + * Applied bytes. + */ + @JsonProperty(value = "appliedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedBytes; + + /** + * Total bytes (if available). + */ + @JsonProperty(value = "totalBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalBytes; + + /** + * Get timestamp when properties were updated. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get per item error count. + * + * @return the perItemErrorCount value + */ + public Long perItemErrorCount() { + return this.perItemErrorCount; + } + + /** + * Get applied item count. + * + * @return the appliedItemCount value + */ + public Long appliedItemCount() { + return this.appliedItemCount; + } + + /** + * Get total item count (if available). + * + * @return the totalItemCount value + */ + public Long totalItemCount() { + return this.totalItemCount; + } + + /** + * Get applied bytes. + * + * @return the appliedBytes value + */ + public Long appliedBytes() { + return this.appliedBytes; + } + + /** + * Get total bytes (if available). + * + * @return the totalBytes value + */ + public Long totalBytes() { + return this.totalBytes; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroup.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroup.java new file mode 100644 index 000000000000..3754d4a9258d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroup.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.SyncGroupInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; + +/** + * Type representing SyncGroup. + */ +public interface SyncGroup extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the syncGroupStatus value. + */ + String syncGroupStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * The entirety of the SyncGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageSyncService, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of SyncGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SyncGroup definition. + */ + interface Blank extends WithStorageSyncService { + } + + /** + * The stage of the syncgroup definition allowing to specify StorageSyncService. + */ + interface WithStorageSyncService { + /** + * Specifies resourceGroupName, storageSyncServiceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param storageSyncServiceName Name of Storage Sync Service resource + * @return the next definition stage + */ + WithProperties withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName); + } + + /** + * The stage of the syncgroup definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The parameters used to create the sync group + * @return the next definition stage + */ + WithCreate withProperties(Object properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a SyncGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of SyncGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the syncgroup update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The parameters used to create the sync group + * @return the next update stage + */ + Update withProperties(Object properties); + } + + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupCreateParameters.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupCreateParameters.java new file mode 100644 index 000000000000..8634e5cf3a28 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupCreateParameters.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The parameters used when creating a sync group. + */ +public class SyncGroupCreateParameters extends ProxyResource { + /** + * The parameters used to create the sync group. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the parameters used to create the sync group. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the parameters used to create the sync group. + * + * @param properties the properties value to set + * @return the SyncGroupCreateParameters object itself. + */ + public SyncGroupCreateParameters withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroups.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroups.java new file mode 100644 index 000000000000..2373a5c0edee --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroups.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.SyncGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SyncGroups. + */ +public interface SyncGroups extends SupportsCreating, HasInner { + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName); + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsCreateHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsCreateHeaders.java new file mode 100644 index 000000000000..b14284c9d750 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsDeleteHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsDeleteHeaders.java new file mode 100644 index 000000000000..b74f496d08b9 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsGetHeaders.java new file mode 100644 index 000000000000..7179013be94f --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsListByStorageSyncServiceHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncGroupsListByStorageSyncServiceHeaders.java new file mode 100644 index 000000000000..86fe8841948b --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncSessionStatus.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncSessionStatus.java new file mode 100644 index 000000000000..33fcfe0ba182 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/SyncSessionStatus.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sync Session status object. + */ +public class SyncSessionStatus { + /** + * Last sync result (HResult). + */ + @JsonProperty(value = "lastSyncResult", access = JsonProperty.Access.WRITE_ONLY) + private Integer lastSyncResult; + + /** + * Last sync timestamp. + */ + @JsonProperty(value = "lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSyncTimestamp; + + /** + * Last sync success timestamp. + */ + @JsonProperty(value = "lastSyncSuccessTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSyncSuccessTimestamp; + + /** + * Last sync per item error count. + */ + @JsonProperty(value = "lastSyncPerItemErrorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long lastSyncPerItemErrorCount; + + /** + * Count of persistent files not syncing. Reserved for future use. + */ + @JsonProperty(value = "persistentFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long persistentFilesNotSyncingCount; + + /** + * Count of transient files not syncing. Reserved for future use. + */ + @JsonProperty(value = "transientFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transientFilesNotSyncingCount; + + /** + * Array of per-item errors coming from the last sync session. Reserved for + * future use. + */ + @JsonProperty(value = "filesNotSyncingErrors", access = JsonProperty.Access.WRITE_ONLY) + private List filesNotSyncingErrors; + + /** + * Get last sync result (HResult). + * + * @return the lastSyncResult value + */ + public Integer lastSyncResult() { + return this.lastSyncResult; + } + + /** + * Get last sync timestamp. + * + * @return the lastSyncTimestamp value + */ + public DateTime lastSyncTimestamp() { + return this.lastSyncTimestamp; + } + + /** + * Get last sync success timestamp. + * + * @return the lastSyncSuccessTimestamp value + */ + public DateTime lastSyncSuccessTimestamp() { + return this.lastSyncSuccessTimestamp; + } + + /** + * Get last sync per item error count. + * + * @return the lastSyncPerItemErrorCount value + */ + public Long lastSyncPerItemErrorCount() { + return this.lastSyncPerItemErrorCount; + } + + /** + * Get count of persistent files not syncing. Reserved for future use. + * + * @return the persistentFilesNotSyncingCount value + */ + public Long persistentFilesNotSyncingCount() { + return this.persistentFilesNotSyncingCount; + } + + /** + * Get count of transient files not syncing. Reserved for future use. + * + * @return the transientFilesNotSyncingCount value + */ + public Long transientFilesNotSyncingCount() { + return this.transientFilesNotSyncingCount; + } + + /** + * Get array of per-item errors coming from the last sync session. Reserved for future use. + * + * @return the filesNotSyncingErrors value + */ + public List filesNotSyncingErrors() { + return this.filesNotSyncingErrors; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/TriggerRolloverRequest.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/TriggerRolloverRequest.java new file mode 100644 index 000000000000..1efbaaa3a99e --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/TriggerRolloverRequest.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Trigger Rollover Request. + */ +public class TriggerRolloverRequest { + /** + * Certificate Data. + */ + @JsonProperty(value = "serverCertificate") + private String serverCertificate; + + /** + * Get certificate Data. + * + * @return the serverCertificate value + */ + public String serverCertificate() { + return this.serverCertificate; + } + + /** + * Set certificate Data. + * + * @param serverCertificate the serverCertificate value to set + * @return the TriggerRolloverRequest object itself. + */ + public TriggerRolloverRequest withServerCertificate(String serverCertificate) { + this.serverCertificate = serverCertificate; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflow.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflow.java new file mode 100644 index 000000000000..adef1e36e84e --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflow.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.WorkflowInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.StorageSyncManager; + +/** + * Type representing Workflow. + */ +public interface Workflow extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastOperationId value. + */ + String lastOperationId(); + + /** + * @return the lastStepName value. + */ + String lastStepName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the steps value. + */ + String steps(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflows.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflows.java new file mode 100644 index 000000000000..f2a5611f27ed --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/Workflows.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.storagesync.v2019_02_01.implementation.WorkflowsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Workflows. + */ +public interface Workflows extends HasInner { + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Completable abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. 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 for the request + */ + Observable getAsync(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName); + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsAbortHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsAbortHeaders.java new file mode 100644 index 000000000000..2e3acaa63c16 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsGetHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsGetHeaders.java new file mode 100644 index 000000000000..46dd0864b238 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01; + +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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsListByStorageSyncServiceHeaders.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsListByStorageSyncServiceHeaders.java new file mode 100644 index 000000000000..b50833833532 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/WorkflowsListByStorageSyncServiceHeaders.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.v2019_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for ListByStorageSyncService operation. + */ +public class WorkflowsListByStorageSyncServiceHeaders { + /** + * 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 WorkflowsListByStorageSyncServiceHeaders object itself. + */ + public WorkflowsListByStorageSyncServiceHeaders 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 WorkflowsListByStorageSyncServiceHeaders object itself. + */ + public WorkflowsListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..30986b18ae21 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.NameAvailabilityReason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final StorageSyncManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, StorageSyncManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public NameAvailabilityReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..5d91c8828973 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a Storage Sync Service name could not be used. The + * Reason element is only returned if NameAvailable is false. Possible + * values include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private NameAvailabilityReason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointImpl.java new file mode 100644 index 000000000000..695439a7bb45 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointImpl.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpoint; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointCreateParameters; +import rx.functions.Func1; + +class CloudEndpointImpl extends CreatableUpdatableImpl implements CloudEndpoint, CloudEndpoint.Definition, CloudEndpoint.Update { + private final StorageSyncManager manager; + private String resourceGroupName; + private String storageSyncServiceName; + private String syncGroupName; + private String cloudEndpointName; + private CloudEndpointCreateParameters createOrUpdateParameter; + + CloudEndpointImpl(String name, StorageSyncManager manager) { + super(name, new CloudEndpointInner()); + this.manager = manager; + // Set resource name + this.cloudEndpointName = name; + // + this.createOrUpdateParameter = new CloudEndpointCreateParameters(); + } + + CloudEndpointImpl(CloudEndpointInner inner, StorageSyncManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.cloudEndpointName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.storageSyncServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageSyncServices"); + this.syncGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "syncGroups"); + this.cloudEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "cloudEndpoints"); + // + this.createOrUpdateParameter = new CloudEndpointCreateParameters(); + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CloudEndpointsInner client = this.manager().inner().cloudEndpoints(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.cloudEndpointName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CloudEndpointInner call(CloudEndpointInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CloudEndpointsInner client = this.manager().inner().cloudEndpoints(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.cloudEndpointName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CloudEndpointInner call(CloudEndpointInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CloudEndpointsInner client = this.manager().inner().cloudEndpoints(); + return client.getAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.cloudEndpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new CloudEndpointCreateParameters(); + } + + @Override + public String azureFileShareName() { + return this.inner().azureFileShareName(); + } + + @Override + public String backupEnabled() { + return this.inner().backupEnabled(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastOperationName() { + return this.inner().lastOperationName(); + } + + @Override + public String lastWorkflowId() { + return this.inner().lastWorkflowId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String partnershipId() { + return this.inner().partnershipId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String storageAccountResourceId() { + return this.inner().storageAccountResourceId(); + } + + @Override + public String storageAccountTenantId() { + return this.inner().storageAccountTenantId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CloudEndpointImpl withExistingSyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + this.syncGroupName = syncGroupName; + return this; + } + + @Override + public CloudEndpointImpl withAzureFileShareName(String azureFileShareName) { + this.createOrUpdateParameter.withAzureFileShareName(azureFileShareName); + return this; + } + + @Override + public CloudEndpointImpl withStorageAccountResourceId(String storageAccountResourceId) { + this.createOrUpdateParameter.withStorageAccountResourceId(storageAccountResourceId); + return this; + } + + @Override + public CloudEndpointImpl withStorageAccountTenantId(String storageAccountTenantId) { + this.createOrUpdateParameter.withStorageAccountTenantId(storageAccountTenantId); + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointInner.java new file mode 100644 index 000000000000..217291276dab --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointInner.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.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 Resource Id. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /** + * Azure file share name. + */ + @JsonProperty(value = "properties.azureFileShareName") + private String azureFileShareName; + + /** + * 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 String backupEnabled; + + /** + * CloudEndpoint Provisioning State. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * CloudEndpoint lastWorkflowId. + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /** + * 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 azure file share name. + * + * @return the azureFileShareName value + */ + public String azureFileShareName() { + return this.azureFileShareName; + } + + /** + * Set azure file share name. + * + * @param azureFileShareName the azureFileShareName value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withAzureFileShareName(String azureFileShareName) { + this.azureFileShareName = azureFileShareName; + 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 String 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; + } + + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsImpl.java new file mode 100644 index 000000000000..a6937e9927fd --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storagesync.v2019_02_01.PostBackupResponse; +import com.microsoft.azure.management.storagesync.v2019_02_01.PreRestoreRequest; +import com.microsoft.azure.management.storagesync.v2019_02_01.PostRestoreRequest; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpoint; + +class CloudEndpointsImpl extends WrapperImpl implements CloudEndpoints { + private final StorageSyncManager manager; + + CloudEndpointsImpl(StorageSyncManager manager) { + super(manager.inner().cloudEndpoints()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public CloudEndpointImpl define(String name) { + return wrapModel(name); + } + + private CloudEndpointImpl wrapModel(CloudEndpointInner inner) { + return new CloudEndpointImpl(inner, manager()); + } + + private CloudEndpointImpl wrapModel(String name) { + return new CloudEndpointImpl(name, this.manager()); + } + + @Override + public Completable preBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointsInner client = this.inner(); + return client.preBackupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toCompletable(); + } + + @Override + public Observable postBackupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointsInner client = this.inner(); + return client.postBackupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .map(new Func1() { + @Override + public PostBackupResponse call(PostBackupResponseInner inner) { + return new PostBackupResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable preRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PreRestoreRequest parameters) { + CloudEndpointsInner client = this.inner(); + return client.preRestoreAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toCompletable(); + } + + @Override + public Completable restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointsInner client = this.inner(); + return client.restoreheartbeatAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toCompletable(); + } + + @Override + public Completable postRestoreAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, PostRestoreRequest parameters) { + CloudEndpointsInner client = this.inner(); + return client.postRestoreAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toCompletable(); + } + + @Override + public Observable listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + CloudEndpointsInner client = this.inner(); + return client.listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CloudEndpoint call(CloudEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap(new Func1>() { + @Override + public Observable call(CloudEndpointInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CloudEndpoint)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toCompletable(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsInner.java new file mode 100644 index 000000000000..0da83d1853c5 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/CloudEndpointsInner.java @@ -0,0 +1,1961 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.v2019_02_01.BackupRequest; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsCreateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsDeleteHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsListBySyncGroupHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsPostBackupHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsPostRestoreHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsPreBackupHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsPreRestoreHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpointsRestoreheartbeatHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.PostRestoreRequest; +import com.microsoft.azure.management.storagesync.v2019_02_01.PreRestoreRequest; +import com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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 CloudEndpointCreateParameters 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.v2019_02_01.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 CloudEndpointCreateParameters 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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.CloudEndpoints restoreheartbeat" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat") + Observable> restoreheartbeat(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("cloudEndpointName") String cloudEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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. 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, CloudEndpointCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, CloudEndpointCreateParameters 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. 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, CloudEndpointCreateParameters 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. 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, CloudEndpointCreateParameters 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. 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, CloudEndpointCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, CloudEndpointCreateParameters 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. 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, CloudEndpointCreateParameters 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. 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, CloudEndpointCreateParameters 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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 restoreheartbeat(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).toBlocking().single().body(); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName), serviceCallback); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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 restoreheartbeatAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return restoreheartbeatWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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> restoreheartbeatWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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.restoreheartbeat(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = restoreheartbeatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders restoreheartbeatDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, CloudEndpointsRestoreheartbeatHeaders.class); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. 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. 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. 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. 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. 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. 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. 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. 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/IdParsingUtils.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..2569fb1f4d40 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationEntityImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationEntityImpl.java new file mode 100644 index 000000000000..55e34a0c4ff2 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationEntityImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.OperationEntity; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.OperationDisplayInfo; + +class OperationEntityImpl extends WrapperImpl implements OperationEntity { + private final StorageSyncManager manager; + OperationEntityImpl(OperationEntityInner inner, StorageSyncManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public OperationDisplayInfo display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationEntityInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationEntityInner.java new file mode 100644 index 000000000000..93d03be58c5a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationsImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..d9b5ddc80e8a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storagesync.v2019_02_01.OperationEntity; + +class OperationsImpl extends WrapperImpl implements Operations { + private final StorageSyncManager manager; + + OperationsImpl(StorageSyncManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationEntity call(OperationEntityInner inner) { + return new OperationEntityImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationsInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..980fe87bc2b1 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.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.v2019_02_01.OperationsListHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PageImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PageImpl.java new file mode 100644 index 000000000000..257e87b4d57b --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PageImpl1.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..c99ce8f9ad4d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PostBackupResponseImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PostBackupResponseImpl.java new file mode 100644 index 000000000000..65376acbab4e --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PostBackupResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.PostBackupResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class PostBackupResponseImpl extends WrapperImpl implements PostBackupResponse { + private final StorageSyncManager manager; + PostBackupResponseImpl(PostBackupResponseInner inner, StorageSyncManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public String cloudEndpointName() { + return this.inner().cloudEndpointName(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PostBackupResponseInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/PostBackupResponseInner.java new file mode 100644 index 000000000000..bbc5f76231c6 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerImpl.java new file mode 100644 index 000000000000..b07d9f908c30 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerImpl.java @@ -0,0 +1,265 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServerCreateParameters; +import rx.functions.Func1; + +class RegisteredServerImpl extends CreatableUpdatableImpl implements RegisteredServer, RegisteredServer.Definition, RegisteredServer.Update { + private final StorageSyncManager manager; + private String resourceGroupName; + private String storageSyncServiceName; + private String serverId; + private RegisteredServerCreateParameters createOrUpdateParameter; + + RegisteredServerImpl(String name, StorageSyncManager manager) { + super(name, new RegisteredServerInner()); + this.manager = manager; + // Set resource name + this.serverId = name; + // + this.createOrUpdateParameter = new RegisteredServerCreateParameters(); + } + + RegisteredServerImpl(RegisteredServerInner inner, StorageSyncManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serverId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.storageSyncServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageSyncServices"); + this.serverId = IdParsingUtils.getValueFromIdByName(inner.id(), "registeredServers"); + // + this.createOrUpdateParameter = new RegisteredServerCreateParameters(); + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RegisteredServersInner client = this.manager().inner().registeredServers(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.serverId, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public RegisteredServerInner call(RegisteredServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegisteredServersInner client = this.manager().inner().registeredServers(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.serverId, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public RegisteredServerInner call(RegisteredServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegisteredServersInner client = this.manager().inner().registeredServers(); + return client.getAsync(this.resourceGroupName, this.storageSyncServiceName, this.serverId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new RegisteredServerCreateParameters(); + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String clusterId() { + return this.inner().clusterId(); + } + + @Override + public String clusterName() { + return this.inner().clusterName(); + } + + @Override + public String discoveryEndpointUri() { + return this.inner().discoveryEndpointUri(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastHeartBeat() { + return this.inner().lastHeartBeat(); + } + + @Override + public String lastOperationName() { + return this.inner().lastOperationName(); + } + + @Override + public String lastWorkflowId() { + return this.inner().lastWorkflowId(); + } + + @Override + public String managementEndpointUri() { + return this.inner().managementEndpointUri(); + } + + @Override + public String monitoringConfiguration() { + return this.inner().monitoringConfiguration(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceLocation() { + return this.inner().resourceLocation(); + } + + @Override + public String serverCertificate() { + return this.inner().serverCertificate(); + } + + @Override + public String serverId() { + return this.inner().serverId(); + } + + @Override + public Integer serverManagementErrorCode() { + return this.inner().serverManagementErrorCode(); + } + + @Override + public String serverOSVersion() { + return this.inner().serverOSVersion(); + } + + @Override + public String serverRole() { + return this.inner().serverRole(); + } + + @Override + public String serviceLocation() { + return this.inner().serviceLocation(); + } + + @Override + public String storageSyncServiceUid() { + return this.inner().storageSyncServiceUid(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RegisteredServerImpl withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + return this; + } + + @Override + public RegisteredServerImpl withAgentVersion(String agentVersion) { + this.createOrUpdateParameter.withAgentVersion(agentVersion); + return this; + } + + @Override + public RegisteredServerImpl withClusterId(String clusterId) { + this.createOrUpdateParameter.withClusterId(clusterId); + return this; + } + + @Override + public RegisteredServerImpl withClusterName(String clusterName) { + this.createOrUpdateParameter.withClusterName(clusterName); + return this; + } + + @Override + public RegisteredServerImpl withFriendlyName(String friendlyName) { + this.createOrUpdateParameter.withFriendlyName(friendlyName); + return this; + } + + @Override + public RegisteredServerImpl withLastHeartBeat(String lastHeartBeat) { + this.createOrUpdateParameter.withLastHeartBeat(lastHeartBeat); + return this; + } + + @Override + public RegisteredServerImpl withServerCertificate(String serverCertificate) { + this.createOrUpdateParameter.withServerCertificate(serverCertificate); + return this; + } + + @Override + public RegisteredServerImpl withServerId(String serverId) { + this.createOrUpdateParameter.withServerId(serverId); + return this; + } + + @Override + public RegisteredServerImpl withServerOSVersion(String serverOSVersion) { + this.createOrUpdateParameter.withServerOSVersion(serverOSVersion); + return this; + } + + @Override + public RegisteredServerImpl withServerRole(String serverRole) { + this.createOrUpdateParameter.withServerRole(serverRole); + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerInner.java new file mode 100644 index 000000000000..6aad60b4989e --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServerInner.java @@ -0,0 +1,514 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Registered Server resource. + */ +@JsonFlatten +public class RegisteredServerInner extends ProxyResource { + /** + * 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.serverManagementErrorCode") + private Integer serverManagementErrorCode; + + /** + * 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; + + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /** + * Resource discoveryEndpointUri. + */ + @JsonProperty(value = "properties.discoveryEndpointUri") + private String discoveryEndpointUri; + + /** + * Resource Location. + */ + @JsonProperty(value = "properties.resourceLocation") + private String resourceLocation; + + /** + * Service Location. + */ + @JsonProperty(value = "properties.serviceLocation") + private String serviceLocation; + + /** + * Friendly Name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Management Endpoint Uri. + */ + @JsonProperty(value = "properties.managementEndpointUri") + private String managementEndpointUri; + + /** + * Monitoring Configuration. + */ + @JsonProperty(value = "properties.monitoringConfiguration") + private String monitoringConfiguration; + + /** + * 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 serverManagementErrorCode value + */ + public Integer serverManagementErrorCode() { + return this.serverManagementErrorCode; + } + + /** + * Set registered Server Management Error Code. + * + * @param serverManagementErrorCode the serverManagementErrorCode value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerManagementErrorCode(Integer serverManagementErrorCode) { + this.serverManagementErrorCode = serverManagementErrorCode; + 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; + } + + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + + /** + * Get resource discoveryEndpointUri. + * + * @return the discoveryEndpointUri value + */ + public String discoveryEndpointUri() { + return this.discoveryEndpointUri; + } + + /** + * Set resource discoveryEndpointUri. + * + * @param discoveryEndpointUri the discoveryEndpointUri value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withDiscoveryEndpointUri(String discoveryEndpointUri) { + this.discoveryEndpointUri = discoveryEndpointUri; + return this; + } + + /** + * Get resource Location. + * + * @return the resourceLocation value + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Set resource Location. + * + * @param resourceLocation the resourceLocation value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withResourceLocation(String resourceLocation) { + this.resourceLocation = resourceLocation; + return this; + } + + /** + * Get service Location. + * + * @return the serviceLocation value + */ + public String serviceLocation() { + return this.serviceLocation; + } + + /** + * Set service Location. + * + * @param serviceLocation the serviceLocation value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServiceLocation(String serviceLocation) { + this.serviceLocation = serviceLocation; + return this; + } + + /** + * 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 RegisteredServerInner object itself. + */ + public RegisteredServerInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get management Endpoint Uri. + * + * @return the managementEndpointUri value + */ + public String managementEndpointUri() { + return this.managementEndpointUri; + } + + /** + * Set management Endpoint Uri. + * + * @param managementEndpointUri the managementEndpointUri value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withManagementEndpointUri(String managementEndpointUri) { + this.managementEndpointUri = managementEndpointUri; + return this; + } + + /** + * Get monitoring Configuration. + * + * @return the monitoringConfiguration value + */ + public String monitoringConfiguration() { + return this.monitoringConfiguration; + } + + /** + * Set monitoring Configuration. + * + * @param monitoringConfiguration the monitoringConfiguration value to set + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withMonitoringConfiguration(String monitoringConfiguration) { + this.monitoringConfiguration = monitoringConfiguration; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersImpl.java new file mode 100644 index 000000000000..8d58b1264063 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServer; + +class RegisteredServersImpl extends WrapperImpl implements RegisteredServers { + private final StorageSyncManager manager; + + RegisteredServersImpl(StorageSyncManager manager) { + super(manager.inner().registeredServers()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public RegisteredServerImpl define(String name) { + return wrapModel(name); + } + + private RegisteredServerImpl wrapModel(RegisteredServerInner inner) { + return new RegisteredServerImpl(inner, manager()); + } + + private RegisteredServerImpl wrapModel(String name) { + return new RegisteredServerImpl(name, this.manager()); + } + + @Override + public Completable triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + RegisteredServersInner client = this.inner(); + return client.triggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId).toCompletable(); + } + + @Override + public Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + RegisteredServersInner client = this.inner(); + return client.listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public RegisteredServer call(RegisteredServerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + RegisteredServersInner client = this.inner(); + return client.getAsync(resourceGroupName, storageSyncServiceName, serverId) + .flatMap(new Func1>() { + @Override + public Observable call(RegisteredServerInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((RegisteredServer)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + RegisteredServersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, storageSyncServiceName, serverId).toCompletable(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersInner.java new file mode 100644 index 000000000000..493691a7da87 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/RegisteredServersInner.java @@ -0,0 +1,985 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServerCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServersCreateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServersDeleteHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServersGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServersListByStorageSyncServiceHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServersTriggerRolloverHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.v2019_02_01.TriggerRolloverRequest; +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 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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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 RegisteredServerCreateParameters 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.v2019_02_01.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 RegisteredServerCreateParameters 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.v2019_02_01.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.v2019_02_01.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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServers triggerRollover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover") + Observable> triggerRollover(@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, @Body TriggerRolloverRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServers beginTriggerRollover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover") + Observable> beginTriggerRollover(@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, @Body TriggerRolloverRequest parameters, @Header("User-Agent") String userAgent); + + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. 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. 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. 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. 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. 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. 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. 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. 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. 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, RegisteredServerCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).toBlocking().last().body(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. 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, RegisteredServerCreateParameters 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. 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, RegisteredServerCreateParameters 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. 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, RegisteredServerCreateParameters 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. 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, RegisteredServerCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).toBlocking().single().body(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. 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, RegisteredServerCreateParameters 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. 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, RegisteredServerCreateParameters 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. 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, RegisteredServerCreateParameters 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. 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. 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. 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. 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. 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. 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. 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. 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); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server 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 triggerRollover(String resourceGroupName, String storageSyncServiceName, String serverId) { + triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).toBlocking().last().body(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server 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 triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId), serviceCallback); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> triggerRolloverWithServiceResponseAsync(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."); + } + final String serverCertificate = null; + TriggerRolloverRequest parameters = new TriggerRolloverRequest(); + parameters.withServerCertificate(null); + Observable> observable = service.triggerRollover(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), RegisteredServersTriggerRolloverHeaders.class); + } + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @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 triggerRollover(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate).toBlocking().last().body(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @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 triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate), serviceCallback); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable triggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + return triggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> triggerRolloverWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + 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."); + } + TriggerRolloverRequest parameters = new TriggerRolloverRequest(); + parameters.withServerCertificate(serverCertificate); + Observable> observable = service.triggerRollover(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), RegisteredServersTriggerRolloverHeaders.class); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server 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 beginTriggerRollover(String resourceGroupName, String storageSyncServiceName, String serverId) { + beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).toBlocking().single().body(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server 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 beginTriggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId), serviceCallback); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginTriggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginTriggerRolloverWithServiceResponseAsync(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."); + } + final String serverCertificate = null; + TriggerRolloverRequest parameters = new TriggerRolloverRequest(); + parameters.withServerCertificate(null); + return service.beginTriggerRollover(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginTriggerRolloverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @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 beginTriggerRollover(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate).toBlocking().single().body(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @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 beginTriggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate), serviceCallback); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginTriggerRolloverAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + return beginTriggerRolloverWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, serverId, serverCertificate).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param serverCertificate Certificate Data + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginTriggerRolloverWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String serverId, String serverCertificate) { + 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."); + } + TriggerRolloverRequest parameters = new TriggerRolloverRequest(); + parameters.withServerCertificate(serverCertificate); + return service.beginTriggerRollover(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, serverId, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginTriggerRolloverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginTriggerRolloverDelegate(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, RegisteredServersTriggerRolloverHeaders.class); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointImpl.java new file mode 100644 index 000000000000..22393558b22a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointImpl.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpoint; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointUpdateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointSyncStatus; +import rx.functions.Func1; + +class ServerEndpointImpl extends CreatableUpdatableImpl implements ServerEndpoint, ServerEndpoint.Definition, ServerEndpoint.Update { + private final StorageSyncManager manager; + private String resourceGroupName; + private String storageSyncServiceName; + private String syncGroupName; + private String serverEndpointName; + private ServerEndpointCreateParameters createParameter; + private ServerEndpointUpdateParameters updateParameter; + + ServerEndpointImpl(String name, StorageSyncManager manager) { + super(name, new ServerEndpointInner()); + this.manager = manager; + // Set resource name + this.serverEndpointName = name; + // + this.createParameter = new ServerEndpointCreateParameters(); + this.updateParameter = new ServerEndpointUpdateParameters(); + } + + ServerEndpointImpl(ServerEndpointInner inner, StorageSyncManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serverEndpointName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.storageSyncServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageSyncServices"); + this.syncGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "syncGroups"); + this.serverEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "serverEndpoints"); + // + this.createParameter = new ServerEndpointCreateParameters(); + this.updateParameter = new ServerEndpointUpdateParameters(); + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServerEndpointsInner client = this.manager().inner().serverEndpoints(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.serverEndpointName, this.createParameter) + .map(new Func1() { + @Override + public ServerEndpointInner call(ServerEndpointInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServerEndpointsInner client = this.manager().inner().serverEndpoints(); + return client.updateAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.serverEndpointName, this.updateParameter) + .map(new Func1() { + @Override + public ServerEndpointInner call(ServerEndpointInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServerEndpointsInner client = this.manager().inner().serverEndpoints(); + return client.getAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.serverEndpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new ServerEndpointCreateParameters(); + this.updateParameter = new ServerEndpointUpdateParameters(); + } + + @Override + public String cloudTiering() { + return this.inner().cloudTiering(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastOperationName() { + return this.inner().lastOperationName(); + } + + @Override + public String lastWorkflowId() { + return this.inner().lastWorkflowId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String offlineDataTransfer() { + return this.inner().offlineDataTransfer(); + } + + @Override + public String offlineDataTransferShareName() { + return this.inner().offlineDataTransferShareName(); + } + + @Override + public String offlineDataTransferStorageAccountResourceId() { + return this.inner().offlineDataTransferStorageAccountResourceId(); + } + + @Override + public String offlineDataTransferStorageAccountTenantId() { + return this.inner().offlineDataTransferStorageAccountTenantId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String serverLocalPath() { + return this.inner().serverLocalPath(); + } + + @Override + public String serverResourceId() { + return this.inner().serverResourceId(); + } + + @Override + public ServerEndpointSyncStatus syncStatus() { + return this.inner().syncStatus(); + } + + @Override + public Integer tierFilesOlderThanDays() { + return this.inner().tierFilesOlderThanDays(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Integer volumeFreeSpacePercent() { + return this.inner().volumeFreeSpacePercent(); + } + + @Override + public ServerEndpointImpl withExistingSyncGroup(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + this.syncGroupName = syncGroupName; + return this; + } + + @Override + public ServerEndpointImpl withFriendlyName(String friendlyName) { + this.createParameter.withFriendlyName(friendlyName); + return this; + } + + @Override + public ServerEndpointImpl withServerLocalPath(String serverLocalPath) { + this.createParameter.withServerLocalPath(serverLocalPath); + return this; + } + + @Override + public ServerEndpointImpl withServerResourceId(String serverResourceId) { + this.createParameter.withServerResourceId(serverResourceId); + return this; + } + + @Override + public ServerEndpointImpl withCloudTiering(String cloudTiering) { + if (isInCreateMode()) { + this.createParameter.withCloudTiering(cloudTiering); + } else { + this.updateParameter.withCloudTiering(cloudTiering); + } + return this; + } + + @Override + public ServerEndpointImpl withOfflineDataTransfer(String offlineDataTransfer) { + if (isInCreateMode()) { + this.createParameter.withOfflineDataTransfer(offlineDataTransfer); + } else { + this.updateParameter.withOfflineDataTransfer(offlineDataTransfer); + } + return this; + } + + @Override + public ServerEndpointImpl withOfflineDataTransferShareName(String offlineDataTransferShareName) { + if (isInCreateMode()) { + this.createParameter.withOfflineDataTransferShareName(offlineDataTransferShareName); + } else { + this.updateParameter.withOfflineDataTransferShareName(offlineDataTransferShareName); + } + return this; + } + + @Override + public ServerEndpointImpl withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + if (isInCreateMode()) { + this.createParameter.withTierFilesOlderThanDays(tierFilesOlderThanDays); + } else { + this.updateParameter.withTierFilesOlderThanDays(tierFilesOlderThanDays); + } + return this; + } + + @Override + public ServerEndpointImpl withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + if (isInCreateMode()) { + this.createParameter.withVolumeFreeSpacePercent(volumeFreeSpacePercent); + } else { + this.updateParameter.withVolumeFreeSpacePercent(volumeFreeSpacePercent); + } + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointInner.java new file mode 100644 index 000000000000..e475fb410e52 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointSyncStatus; +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; + + /** + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /** + * Friendly Name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Server Resource Id. + */ + @JsonProperty(value = "properties.serverResourceId") + private String serverResourceId; + + /** + * ServerEndpoint Provisioning State. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * ServerEndpoint lastWorkflowId. + */ + @JsonProperty(value = "properties.lastWorkflowId", access = JsonProperty.Access.WRITE_ONLY) + private String lastWorkflowId; + + /** + * Resource Last Operation Name. + */ + @JsonProperty(value = "properties.lastOperationName", access = JsonProperty.Access.WRITE_ONLY) + private String lastOperationName; + + /** + * Server Endpoint sync status. + */ + @JsonProperty(value = "properties.syncStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncStatus syncStatus; + + /** + * Offline data transfer. Possible values include: 'on', 'off'. + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private String offlineDataTransfer; + + /** + * Offline data transfer storage account resource ID. + */ + @JsonProperty(value = "properties.offlineDataTransferStorageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountResourceId; + + /** + * Offline data transfer storage account tenant ID. + */ + @JsonProperty(value = "properties.offlineDataTransferStorageAccountTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountTenantId; + + /** + * Offline data transfer share name. + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /** + * 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 tier files older than days. + * + * @return the tierFilesOlderThanDays value + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + 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 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; + } + + /** + * Get serverEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Get resource Last Operation Name. + * + * @return the lastOperationName value + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Get server Endpoint sync status. + * + * @return the syncStatus value + */ + public ServerEndpointSyncStatus syncStatus() { + return this.syncStatus; + } + + /** + * Get offline data transfer. Possible values include: 'on', 'off'. + * + * @return the offlineDataTransfer value + */ + public String offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set offline data transfer. Possible values include: 'on', 'off'. + * + * @param offlineDataTransfer the offlineDataTransfer value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withOfflineDataTransfer(String offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get offline data transfer storage account resource ID. + * + * @return the offlineDataTransferStorageAccountResourceId value + */ + public String offlineDataTransferStorageAccountResourceId() { + return this.offlineDataTransferStorageAccountResourceId; + } + + /** + * Get offline data transfer storage account tenant ID. + * + * @return the offlineDataTransferStorageAccountTenantId value + */ + public String offlineDataTransferStorageAccountTenantId() { + return this.offlineDataTransferStorageAccountTenantId; + } + + /** + * Get offline data transfer share name. + * + * @return the offlineDataTransferShareName value + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsImpl.java new file mode 100644 index 000000000000..cecdb2ea454a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storagesync.v2019_02_01.RecallActionParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpoint; + +class ServerEndpointsImpl extends WrapperImpl implements ServerEndpoints { + private final StorageSyncManager manager; + + ServerEndpointsImpl(StorageSyncManager manager) { + super(manager.inner().serverEndpoints()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public ServerEndpointImpl define(String name) { + return wrapModel(name); + } + + private ServerEndpointImpl wrapModel(ServerEndpointInner inner) { + return new ServerEndpointImpl(inner, manager()); + } + + private ServerEndpointImpl wrapModel(String name) { + return new ServerEndpointImpl(name, this.manager()); + } + + @Override + public Completable recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters) { + ServerEndpointsInner client = this.inner(); + return client.recallActionAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toCompletable(); + } + + @Override + public Observable listBySyncGroupAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + ServerEndpointsInner client = this.inner(); + return client.listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ServerEndpoint call(ServerEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + ServerEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + .flatMap(new Func1>() { + @Override + public Observable call(ServerEndpointInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ServerEndpoint)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + ServerEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).toCompletable(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsInner.java new file mode 100644 index 000000000000..b6b7ad304f8a --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/ServerEndpointsInner.java @@ -0,0 +1,1261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.v2019_02_01.RecallActionParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsCreateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsDeleteHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsListBySyncGroupHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsRecallActionHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointsUpdateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpointUpdateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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 ServerEndpointCreateParameters 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.v2019_02_01.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 ServerEndpointCreateParameters 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.v2019_02_01.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 ServerEndpointUpdateParameters 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.v2019_02_01.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 ServerEndpointUpdateParameters 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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.ServerEndpoints recallAction" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") + Observable> recallAction(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @Query("api-version") String apiVersion, @Body RecallActionParameters 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.v2019_02_01.ServerEndpoints beginRecallAction" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction") + Observable> beginRecallAction(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("storageSyncServiceName") String storageSyncServiceName, @Path("syncGroupName") String syncGroupName, @Path("serverEndpointName") String serverEndpointName, @Query("api-version") String apiVersion, @Body RecallActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, ServerEndpointCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, ServerEndpointCreateParameters 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. 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, ServerEndpointCreateParameters 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. 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, ServerEndpointCreateParameters 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. 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, ServerEndpointCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, ServerEndpointCreateParameters 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. 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, ServerEndpointCreateParameters 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. 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, ServerEndpointCreateParameters 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. 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. 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. 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. 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 ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters 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. 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. 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. 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. 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 ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. 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, ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters 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. 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, ServerEndpointUpdateParameters 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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 server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action 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 recallAction(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters) { + recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action 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 recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable recallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters) { + return recallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> recallActionWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters 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.recallAction(this.client.subscriptionId(), resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), ServerEndpointsRecallActionHeaders.class); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action 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 beginRecallAction(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters) { + beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action 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 beginRecallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters), serviceCallback); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginRecallActionAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters parameters) { + return beginRecallActionWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. 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 Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginRecallActionWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName, RecallActionParameters 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.beginRecallAction(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 = beginRecallActionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginRecallActionDelegate(Response response) throws StorageSyncErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(StorageSyncErrorException.class) + .buildWithHeaders(response, ServerEndpointsRecallActionHeaders.class); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncManagementClientImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncManagementClientImpl.java new file mode 100644 index 000000000000..f123ffb13551 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the 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; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public StorageSyncManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * 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; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * 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; + } + + /** Whether a unique x-ms-client-request-id should be generated. 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 Whether a unique x-ms-client-request-id should be generated. 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 Whether a unique x-ms-client-request-id should be generated. 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://management.azure.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 = "2019-02-01"; + 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, auto-generated)", super.userAgent(), "StorageSyncManagementClient", "2019-02-01"); + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncManager.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncManager.java new file mode 100644 index 000000000000..0a3f69cec636 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.storagesync.v2019_02_01.Operations; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServices; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroups; +import com.microsoft.azure.management.storagesync.v2019_02_01.CloudEndpoints; +import com.microsoft.azure.management.storagesync.v2019_02_01.ServerEndpoints; +import com.microsoft.azure.management.storagesync.v2019_02_01.RegisteredServers; +import com.microsoft.azure.management.storagesync.v2019_02_01.Workflows; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure StorageSync resource management. + */ +public final class StorageSyncManager extends ManagerCore { + private Operations operations; + private StorageSyncServices storageSyncServices; + private SyncGroups syncGroups; + private CloudEndpoints cloudEndpoints; + private ServerEndpoints serverEndpoints; + private RegisteredServers registeredServers; + private Workflows workflows; + /** + * Get a Configurable instance that can be used to create StorageSyncManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new StorageSyncManager.ConfigurableImpl(); + } + /** + * Creates an instance of StorageSyncManager that exposes StorageSync resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageSyncManager + */ + public static StorageSyncManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new StorageSyncManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of StorageSyncManager that exposes StorageSync resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageSyncManager + */ + public static StorageSyncManager authenticate(RestClient restClient, String subscriptionId) { + return new StorageSyncManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageSyncManager that exposes StorageSync management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing StorageSync management API entry points that work across subscriptions + */ + StorageSyncManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage StorageSyncServices. + */ + public StorageSyncServices storageSyncServices() { + if (this.storageSyncServices == null) { + this.storageSyncServices = new StorageSyncServicesImpl(this); + } + return this.storageSyncServices; + } + + /** + * @return Entry point to manage SyncGroups. + */ + public SyncGroups syncGroups() { + if (this.syncGroups == null) { + this.syncGroups = new SyncGroupsImpl(this); + } + return this.syncGroups; + } + + /** + * @return Entry point to manage CloudEndpoints. + */ + public CloudEndpoints cloudEndpoints() { + if (this.cloudEndpoints == null) { + this.cloudEndpoints = new CloudEndpointsImpl(this); + } + return this.cloudEndpoints; + } + + /** + * @return Entry point to manage ServerEndpoints. + */ + public ServerEndpoints serverEndpoints() { + if (this.serverEndpoints == null) { + this.serverEndpoints = new ServerEndpointsImpl(this); + } + return this.serverEndpoints; + } + + /** + * @return Entry point to manage RegisteredServers. + */ + public RegisteredServers registeredServers() { + if (this.registeredServers == null) { + this.registeredServers = new RegisteredServersImpl(this); + } + return this.registeredServers; + } + + /** + * @return Entry point to manage Workflows. + */ + public Workflows workflows() { + if (this.workflows == null) { + this.workflows = new WorkflowsImpl(this); + } + return this.workflows; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public StorageSyncManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return StorageSyncManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private StorageSyncManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new StorageSyncManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceImpl.java new file mode 100644 index 000000000000..b5c4d3941107 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceImpl.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncService; +import rx.Observable; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServiceUpdateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServiceCreateParameters; +import rx.functions.Func1; + +class StorageSyncServiceImpl extends GroupableResourceCoreImpl implements StorageSyncService, StorageSyncService.Definition, StorageSyncService.Update { + private StorageSyncServiceCreateParameters createParameter; + private StorageSyncServiceUpdateParameters updateParameter; + StorageSyncServiceImpl(String name, StorageSyncServiceInner inner, StorageSyncManager manager) { + super(name, inner, manager); + this.createParameter = new StorageSyncServiceCreateParameters(); + this.updateParameter = new StorageSyncServiceUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + StorageSyncServicesInner client = this.manager().inner().storageSyncServices(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public StorageSyncServiceInner call(StorageSyncServiceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageSyncServicesInner client = this.manager().inner().storageSyncServices(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public StorageSyncServiceInner call(StorageSyncServiceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageSyncServicesInner client = this.manager().inner().storageSyncServices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new StorageSyncServiceCreateParameters(); + this.updateParameter = new StorageSyncServiceUpdateParameters(); + } + + @Override + public Integer storageSyncServiceStatus() { + return this.inner().storageSyncServiceStatus(); + } + + @Override + public String storageSyncServiceUid() { + return this.inner().storageSyncServiceUid(); + } + + @Override + public StorageSyncServiceImpl withProperties(Object properties) { + if (isInCreateMode()) { + this.createParameter.withProperties(properties); + } else { + this.updateParameter.withProperties(properties); + } + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceInner.java new file mode 100644 index 000000000000..5857fa1b510e --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServiceInner.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.v2019_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Storage Sync Service object. + */ +@JsonFlatten +public class StorageSyncServiceInner extends Resource { + /** + * 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesImpl.java new file mode 100644 index 000000000000..18cb47262e47 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesImpl.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. + * def + */ + +package com.microsoft.azure.management.storagesync.v2019_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServices; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storagesync.v2019_02_01.CheckNameAvailabilityResult; + +class StorageSyncServicesImpl extends GroupableResourcesCoreImpl implements StorageSyncServices { + protected StorageSyncServicesImpl(StorageSyncManager manager) { + super(manager.inner().storageSyncServices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + StorageSyncServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + StorageSyncServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + StorageSyncServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + StorageSyncServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageSyncService call(StorageSyncServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + StorageSyncServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + StorageSyncServicesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageSyncService call(StorageSyncServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public StorageSyncServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + protected StorageSyncServiceImpl wrapModel(StorageSyncServiceInner inner) { + return new StorageSyncServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected StorageSyncServiceImpl wrapModel(String name) { + return new StorageSyncServiceImpl(name, new StorageSyncServiceInner(), this.manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String locationName, String name) { + StorageSyncServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(locationName, name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesInner.java new file mode 100644 index 000000000000..4d6d2b2fec20 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/StorageSyncServicesInner.java @@ -0,0 +1,800 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storagesync.v2019_02_01.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServiceCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServicesDeleteHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServicesGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServicesListByResourceGroupHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServicesListBySubscriptionHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServicesUpdateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncServiceUpdateParameters; +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.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 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.v2019_02_01.StorageSyncServices checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.v2019_02_01.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 StorageSyncServiceCreateParameters 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.v2019_02_01.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.v2019_02_01.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 StorageSyncServiceUpdateParameters 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.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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); + + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).toBlocking().single().body(); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String locationName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, name), serviceCallback); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, String name) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CheckNameAvailabilityParameters parameters = new CheckNameAvailabilityParameters(); + parameters.withName(name); + return service.checkNameAvailability(locationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. 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, StorageSyncServiceCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).toBlocking().single().body(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. 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, StorageSyncServiceCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters), serviceCallback); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. 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, StorageSyncServiceCreateParameters 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. 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, StorageSyncServiceCreateParameters 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. 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. 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. 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. 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. 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. 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. 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. 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 StorageSyncServiceUpdateParameters 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. 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, StorageSyncServiceUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters).toBlocking().single().body(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. 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, StorageSyncServiceUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, parameters), serviceCallback); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. 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, StorageSyncServiceUpdateParameters 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. 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, StorageSyncServiceUpdateParameters 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. 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. 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. 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. 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. 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. 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. 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. 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupImpl.java new file mode 100644 index 000000000000..d9d54ed1b91f --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroup; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class SyncGroupImpl extends CreatableUpdatableImpl implements SyncGroup, SyncGroup.Definition, SyncGroup.Update { + private final StorageSyncManager manager; + private String resourceGroupName; + private String storageSyncServiceName; + private String syncGroupName; + private Object cproperties; + private Object uproperties; + + SyncGroupImpl(String name, StorageSyncManager manager) { + super(name, new SyncGroupInner()); + this.manager = manager; + // Set resource name + this.syncGroupName = name; + // + } + + SyncGroupImpl(SyncGroupInner inner, StorageSyncManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.syncGroupName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.storageSyncServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageSyncServices"); + this.syncGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "syncGroups"); + // + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SyncGroupsInner client = this.manager().inner().syncGroups(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.cproperties) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SyncGroupsInner client = this.manager().inner().syncGroups(); + return client.createAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName, this.uproperties) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SyncGroupsInner client = this.manager().inner().syncGroups(); + return client.getAsync(this.resourceGroupName, this.storageSyncServiceName, this.syncGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String syncGroupStatus() { + return this.inner().syncGroupStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueId() { + return this.inner().uniqueId(); + } + + @Override + public SyncGroupImpl withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + return this; + } + + @Override + public SyncGroupImpl withProperties(Object properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupInner.java new file mode 100644 index 000000000000..9334f734daf5 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsImpl.java new file mode 100644 index 000000000000..61a5073d69c5 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsImpl.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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroups; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroup; + +class SyncGroupsImpl extends WrapperImpl implements SyncGroups { + private final StorageSyncManager manager; + + SyncGroupsImpl(StorageSyncManager manager) { + super(manager.inner().syncGroups()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + @Override + public SyncGroupImpl define(String name) { + return wrapModel(name); + } + + private SyncGroupImpl wrapModel(SyncGroupInner inner) { + return new SyncGroupImpl(inner, manager()); + } + + private SyncGroupImpl wrapModel(String name) { + return new SyncGroupImpl(name, this.manager()); + } + + @Override + public Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + SyncGroupsInner client = this.inner(); + return client.listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SyncGroup call(SyncGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + SyncGroupsInner client = this.inner(); + return client.getAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(SyncGroupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SyncGroup)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + SyncGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName).toCompletable(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsInner.java new file mode 100644 index 000000000000..8cf0eb021f07 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/SyncGroupsInner.java @@ -0,0 +1,546 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroupCreateParameters; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroupsCreateHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroupsDeleteHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.SyncGroupsGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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.v2019_02_01.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 SyncGroupCreateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagesync.v2019_02_01.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.v2019_02_01.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. 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. 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. 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. 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. 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. 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. 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. 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 Object properties = null; + SyncGroupCreateParameters parameters = new SyncGroupCreateParameters(); + parameters.withProperties(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. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param properties The parameters used to create the sync group + * @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, Object properties) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, properties).toBlocking().single().body(); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param properties The parameters used to create the sync group + * @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, Object properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, properties), serviceCallback); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param properties The parameters used to create the sync group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable createAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, Object properties) { + return createWithServiceResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, properties).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. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param properties The parameters used to create the sync group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SyncGroupInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName, Object properties) { + 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."); + } + SyncGroupCreateParameters parameters = new SyncGroupCreateParameters(); + parameters.withProperties(properties); + 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. 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. 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. 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. 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. 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. 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. 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. 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowImpl.java new file mode 100644 index 000000000000..c08731d3ab45 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.management.storagesync.v2019_02_01.Workflow; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class WorkflowImpl extends IndexableRefreshableWrapperImpl implements Workflow { + private final StorageSyncManager manager; + private String resourceGroupName; + private String storageSyncServiceName; + private String workflowId; + + WorkflowImpl(WorkflowInner inner, StorageSyncManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.storageSyncServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageSyncServices"); + this.workflowId = IdParsingUtils.getValueFromIdByName(inner.id(), "workflows"); + } + + @Override + public StorageSyncManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + WorkflowsInner client = this.manager().inner().workflows(); + return client.getAsync(this.resourceGroupName, this.storageSyncServiceName, this.workflowId); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastOperationId() { + return this.inner().lastOperationId(); + } + + @Override + public String lastStepName() { + return this.inner().lastStepName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String steps() { + return this.inner().steps(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowInner.java new file mode 100644 index 000000000000..04add37b40f9 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsImpl.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsImpl.java new file mode 100644 index 000000000000..df203ee846aa --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagesync.v2019_02_01.Workflows; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import rx.Completable; +import com.microsoft.azure.management.storagesync.v2019_02_01.Workflow; + +class WorkflowsImpl extends WrapperImpl implements Workflows { + private final StorageSyncManager manager; + + WorkflowsImpl(StorageSyncManager manager) { + super(manager.inner().workflows()); + this.manager = manager; + } + + public StorageSyncManager manager() { + return this.manager; + } + + private WorkflowImpl wrapModel(WorkflowInner inner) { + return new WorkflowImpl(inner, manager()); + } + + @Override + public Completable abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + WorkflowsInner client = this.inner(); + return client.abortAsync(resourceGroupName, storageSyncServiceName, workflowId).toCompletable(); + } + + @Override + public Observable listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + WorkflowsInner client = this.inner(); + return client.listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Workflow call(WorkflowInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + WorkflowsInner client = this.inner(); + return client.getAsync(resourceGroupName, storageSyncServiceName, workflowId) + .flatMap(new Func1>() { + @Override + public Observable call(WorkflowInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Workflow)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsInner.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsInner.java new file mode 100644 index 000000000000..7a786cd89cd4 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/WorkflowsInner.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2019_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storagesync.v2019_02_01.StorageSyncErrorException; +import com.microsoft.azure.management.storagesync.v2019_02_01.WorkflowsAbortHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.WorkflowsGetHeaders; +import com.microsoft.azure.management.storagesync.v2019_02_01.WorkflowsListByStorageSyncServiceHeaders; +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.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.v2019_02_01.Workflows listByStorageSyncService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows") + 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.v2019_02_01.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.v2019_02_01.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 a Workflow List. + * + * @param resourceGroupName The name of the resource group. 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<WorkflowInner> object if successful. + */ + public List listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).toBlocking().single().body(); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. 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 Workflow List. + * + * @param resourceGroupName The name of the resource group. 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<WorkflowInner> object + */ + public Observable> listByStorageSyncServiceAsync(String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithServiceResponseAsync(resourceGroupName, storageSyncServiceName).map(new Func1, WorkflowsListByStorageSyncServiceHeaders>, List>() { + @Override + public List call(ServiceResponseWithHeaders, WorkflowsListByStorageSyncServiceHeaders> response) { + return response.body(); + } + }); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. 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<WorkflowInner> object + */ + public Observable, WorkflowsListByStorageSyncServiceHeaders>> 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, WorkflowsListByStorageSyncServiceHeaders>>>() { + @Override + public Observable, WorkflowsListByStorageSyncServiceHeaders>> 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, WorkflowsListByStorageSyncServiceHeaders> 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, WorkflowsListByStorageSyncServiceHeaders.class); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. 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. 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. 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. 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. 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. 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. 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. 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/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/package-info.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/implementation/package-info.java new file mode 100644 index 000000000000..f781ed281e8d --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01.implementation; diff --git a/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/package-info.java b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/package-info.java new file mode 100644 index 000000000000..2a5b1f848b50 --- /dev/null +++ b/sdk/storagesync/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/storagesync/v2019_02_01/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.v2019_02_01;