diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/AvailableProviderOperationDisplay.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/AvailableProviderOperationDisplay.java new file mode 100644 index 000000000000..95a0bfecaaff --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/AvailableProviderOperationDisplay.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / + * action. + * These value will be used by several clients for + * (1) custom role definitions for RBAC; + * (2) complex query filters for the event service; and (3) audit history / + * records for management operations. + */ +public class AvailableProviderOperationDisplay { + /** + * Gets or sets Provider + * The localized friendly form of the resource provider name – it is + * expected to also include the publisher/company responsible. + * It should use Title Casing and begin with “Microsoft” for 1st party + * services. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Gets or sets Resource + * The localized friendly form of the resource type related to this + * action/operation – it should match the public documentation for the + * resource provider. + * It should use Title Casing – for examples, please refer to the “name” + * section. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Gets or sets Operation + * The localized friendly name for the operation, as it should be shown to + * the user. + * It should be concise (to fit in drop downs) but clear (i.e. + * self-documenting). It should use Title Casing and include the + * entity/resource to which it applies. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Gets or sets Description + * The localized friendly description for the operation, as it should be + * shown to the user. + * It should be thorough, yet concise – it will be used in tool tips and + * detailed views. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get gets or sets Provider + The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party services. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set gets or sets Provider + The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party services. + * + * @param provider the provider value to set + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get gets or sets Resource + The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. + It should use Title Casing – for examples, please refer to the “name” section. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set gets or sets Resource + The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. + It should use Title Casing – for examples, please refer to the “name” section. + * + * @param resource the resource value to set + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get gets or sets Operation + The localized friendly name for the operation, as it should be shown to the user. + It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set gets or sets Operation + The localized friendly name for the operation, as it should be shown to the user. + It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies. + * + * @param operation the operation value to set + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get gets or sets Description + The localized friendly description for the operation, as it should be shown to the user. + It should be thorough, yet concise – it will be used in tool tips and detailed views. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set gets or sets Description + The localized friendly description for the operation, as it should be shown to the user. + It should be thorough, yet concise – it will be used in tool tips and detailed views. + * + * @param description the description value to set + * @return the AvailableProviderOperationDisplay object itself. + */ + public AvailableProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/CustomerSecret.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/CustomerSecret.java new file mode 100644 index 000000000000..f478c7c234d8 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/CustomerSecret.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The pair of customer secret. + */ +public class CustomerSecret { + /** + * The identifier to the data service input object which this secret + * corresponds to. + */ + @JsonProperty(value = "keyIdentifier", required = true) + private String keyIdentifier; + + /** + * It contains the encrypted customer secret. + */ + @JsonProperty(value = "keyValue", required = true) + private String keyValue; + + /** + * The encryption algorithm used to encrypt data. Possible values include: + * 'None', 'RSA1_5', 'RSA_OAEP', 'PlainText'. + */ + @JsonProperty(value = "algorithm", required = true) + private SupportedAlgorithm algorithm; + + /** + * Get the identifier to the data service input object which this secret corresponds to. + * + * @return the keyIdentifier value + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the identifier to the data service input object which this secret corresponds to. + * + * @param keyIdentifier the keyIdentifier value to set + * @return the CustomerSecret object itself. + */ + public CustomerSecret withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get it contains the encrypted customer secret. + * + * @return the keyValue value + */ + public String keyValue() { + return this.keyValue; + } + + /** + * Set it contains the encrypted customer secret. + * + * @param keyValue the keyValue value to set + * @return the CustomerSecret object itself. + */ + public CustomerSecret withKeyValue(String keyValue) { + this.keyValue = keyValue; + return this; + } + + /** + * Get the encryption algorithm used to encrypt data. Possible values include: 'None', 'RSA1_5', 'RSA_OAEP', 'PlainText'. + * + * @return the algorithm value + */ + public SupportedAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Set the encryption algorithm used to encrypt data. Possible values include: 'None', 'RSA1_5', 'RSA_OAEP', 'PlainText'. + * + * @param algorithm the algorithm value to set + * @return the CustomerSecret object itself. + */ + public CustomerSecret withAlgorithm(SupportedAlgorithm algorithm) { + this.algorithm = algorithm; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataManagerUpdateParameter.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataManagerUpdateParameter.java new file mode 100644 index 000000000000..3be121b77399 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataManagerUpdateParameter.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DataManagerUpdateParameter. + */ +public class DataManagerUpdateParameter { + /** + * The sku type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The list of key value pairs that describe the resource. These tags can + * be used in viewing and grouping this resource + * (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the sku type. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku type. + * + * @param sku the sku value to set + * @return the DataManagerUpdateParameter object itself. + */ + public DataManagerUpdateParameter withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource + (across resource groups). + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource + (across resource groups). + * + * @param tags the tags value to set + * @return the DataManagerUpdateParameter object itself. + */ + public DataManagerUpdateParameter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataStoreFilter.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataStoreFilter.java new file mode 100644 index 000000000000..6012a1c074da --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DataStoreFilter.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the information about the filters for the DataStore. + */ +public class DataStoreFilter { + /** + * The data store type id. + */ + @JsonProperty(value = "dataStoreTypeId") + private String dataStoreTypeId; + + /** + * Get the data store type id. + * + * @return the dataStoreTypeId value + */ + public String dataStoreTypeId() { + return this.dataStoreTypeId; + } + + /** + * Set the data store type id. + * + * @param dataStoreTypeId the dataStoreTypeId value to set + * @return the DataStoreFilter object itself. + */ + public DataStoreFilter withDataStoreTypeId(String dataStoreTypeId) { + this.dataStoreTypeId = dataStoreTypeId; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DmsBaseObject.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DmsBaseObject.java new file mode 100644 index 000000000000..bf4eafd0b358 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/DmsBaseObject.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for all objects under DataManager Service. + */ +public class DmsBaseObject { + /** + * Name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Id of the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get id of the object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get type of the object. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Error.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Error.java new file mode 100644 index 000000000000..8cf63dcae11d --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Error.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Top level error for the job. + */ +public class Error { + /** + * Error code that can be used to programmatically identify the error. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * Describes the error in detail and provides debugging information. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code that can be used to programmatically identify the error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code that can be used to programmatically identify the error. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get describes the error in detail and provides debugging information. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set describes the error in detail and provides debugging information. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/ErrorDetails.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/ErrorDetails.java new file mode 100644 index 000000000000..d8930ed1c1cd --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/ErrorDetails.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Details. + */ +public class ErrorDetails { + /** + * Error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /** + * Recommended action for the error. + */ + @JsonProperty(value = "recommendedAction") + private String recommendedAction; + + /** + * Contains the non localized exception message. + */ + @JsonProperty(value = "exceptionMessage") + private String exceptionMessage; + + /** + * Get error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set error message. + * + * @param errorMessage the errorMessage value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get error code. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set error code. + * + * @param errorCode the errorCode value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get recommended action for the error. + * + * @return the recommendedAction value + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Set recommended action for the error. + * + * @param recommendedAction the recommendedAction value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withRecommendedAction(String recommendedAction) { + this.recommendedAction = recommendedAction; + return this; + } + + /** + * Get contains the non localized exception message. + * + * @return the exceptionMessage value + */ + public String exceptionMessage() { + return this.exceptionMessage; + } + + /** + * Set contains the non localized exception message. + * + * @param exceptionMessage the exceptionMessage value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withExceptionMessage(String exceptionMessage) { + this.exceptionMessage = exceptionMessage; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/IsJobCancellable.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/IsJobCancellable.java new file mode 100644 index 000000000000..6886b8d89dd1 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/IsJobCancellable.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IsJobCancellable. + */ +public enum IsJobCancellable { + /** Enum value NotCancellable. */ + NOT_CANCELLABLE("NotCancellable"), + + /** Enum value Cancellable. */ + CANCELLABLE("Cancellable"); + + /** The actual serialized value for a IsJobCancellable instance. */ + private String value; + + IsJobCancellable(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IsJobCancellable instance. + * + * @param value the serialized value to parse. + * @return the parsed IsJobCancellable object, or null if unable to parse. + */ + @JsonCreator + public static IsJobCancellable fromString(String value) { + IsJobCancellable[] items = IsJobCancellable.values(); + for (IsJobCancellable item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDefinitionFilter.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDefinitionFilter.java new file mode 100644 index 000000000000..05c2c9dc96e2 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDefinitionFilter.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the supported job definition filters. + */ +public class JobDefinitionFilter { + /** + * The state of the job definition. Possible values include: 'Disabled', + * 'Enabled', 'Supported'. + */ + @JsonProperty(value = "state", required = true) + private State state; + + /** + * The data source associated with the job definition. + */ + @JsonProperty(value = "dataSource") + private String dataSource; + + /** + * The last modified date time of the data source. + */ + @JsonProperty(value = "lastModified") + private DateTime lastModified; + + /** + * Get the state of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set the state of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @param state the state value to set + * @return the JobDefinitionFilter object itself. + */ + public JobDefinitionFilter withState(State state) { + this.state = state; + return this; + } + + /** + * Get the data source associated with the job definition. + * + * @return the dataSource value + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the data source associated with the job definition. + * + * @param dataSource the dataSource value to set + * @return the JobDefinitionFilter object itself. + */ + public JobDefinitionFilter withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the last modified date time of the data source. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Set the last modified date time of the data source. + * + * @param lastModified the lastModified value to set + * @return the JobDefinitionFilter object itself. + */ + public JobDefinitionFilter withLastModified(DateTime lastModified) { + this.lastModified = lastModified; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDetails.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDetails.java new file mode 100644 index 000000000000..e2e75455f221 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobDetails.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import java.util.List; +import com.microsoft.azure.management.hybriddata.implementation.JobDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Job details. + */ +public class JobDetails { + /** + * List of stages that ran in the job. + */ + @JsonProperty(value = "jobStages") + private List jobStages; + + /** + * JobDefinition at the time of the run. + */ + @JsonProperty(value = "jobDefinition") + private JobDefinitionInner jobDefinition; + + /** + * Error details for failure. This is optional. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Item Details Link to download files or see details. + */ + @JsonProperty(value = "itemDetailsLink") + private String itemDetailsLink; + + /** + * Get list of stages that ran in the job. + * + * @return the jobStages value + */ + public List jobStages() { + return this.jobStages; + } + + /** + * Set list of stages that ran in the job. + * + * @param jobStages the jobStages value to set + * @return the JobDetails object itself. + */ + public JobDetails withJobStages(List jobStages) { + this.jobStages = jobStages; + return this; + } + + /** + * Get jobDefinition at the time of the run. + * + * @return the jobDefinition value + */ + public JobDefinitionInner jobDefinition() { + return this.jobDefinition; + } + + /** + * Set jobDefinition at the time of the run. + * + * @param jobDefinition the jobDefinition value to set + * @return the JobDetails object itself. + */ + public JobDetails withJobDefinition(JobDefinitionInner jobDefinition) { + this.jobDefinition = jobDefinition; + return this; + } + + /** + * Get error details for failure. This is optional. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details for failure. This is optional. + * + * @param errorDetails the errorDetails value to set + * @return the JobDetails object itself. + */ + public JobDetails withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get item Details Link to download files or see details. + * + * @return the itemDetailsLink value + */ + public String itemDetailsLink() { + return this.itemDetailsLink; + } + + /** + * Set item Details Link to download files or see details. + * + * @param itemDetailsLink the itemDetailsLink value to set + * @return the JobDetails object itself. + */ + public JobDetails withItemDetailsLink(String itemDetailsLink) { + this.itemDetailsLink = itemDetailsLink; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobFilter.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobFilter.java new file mode 100644 index 000000000000..b486cdad1492 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobFilter.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybriddata; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the information about the filters for the job. + */ +public class JobFilter { + /** + * The status of the job. Possible values include: 'None', 'InProgress', + * 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + */ + @JsonProperty(value = "status", required = true) + private JobStatus status; + + /** + * The start time of the job. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Get the status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + + /** + * Set the status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @param status the status value to set + * @return the JobFilter object itself. + */ + public JobFilter withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get the start time of the job. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the job. + * + * @param startTime the startTime value to set + * @return the JobFilter object itself. + */ + public JobFilter withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStages.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStages.java new file mode 100644 index 000000000000..c21f176c84e1 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStages.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Job stages. + */ +public class JobStages { + /** + * Name of the job stage. + */ + @JsonProperty(value = "stageName") + private String stageName; + + /** + * Status of the job stage. Possible values include: 'None', 'InProgress', + * 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + */ + @JsonProperty(value = "stageStatus", required = true) + private JobStatus stageStatus; + + /** + * Job Stage Details. + */ + @JsonProperty(value = "jobStageDetails") + private Object jobStageDetails; + + /** + * Error details for the stage. This is optional. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Get name of the job stage. + * + * @return the stageName value + */ + public String stageName() { + return this.stageName; + } + + /** + * Set name of the job stage. + * + * @param stageName the stageName value to set + * @return the JobStages object itself. + */ + public JobStages withStageName(String stageName) { + this.stageName = stageName; + return this; + } + + /** + * Get status of the job stage. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @return the stageStatus value + */ + public JobStatus stageStatus() { + return this.stageStatus; + } + + /** + * Set status of the job stage. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @param stageStatus the stageStatus value to set + * @return the JobStages object itself. + */ + public JobStages withStageStatus(JobStatus stageStatus) { + this.stageStatus = stageStatus; + return this; + } + + /** + * Get job Stage Details. + * + * @return the jobStageDetails value + */ + public Object jobStageDetails() { + return this.jobStageDetails; + } + + /** + * Set job Stage Details. + * + * @param jobStageDetails the jobStageDetails value to set + * @return the JobStages object itself. + */ + public JobStages withJobStageDetails(Object jobStageDetails) { + this.jobStageDetails = jobStageDetails; + return this; + } + + /** + * Get error details for the stage. This is optional. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details for the stage. This is optional. + * + * @param errorDetails the errorDetails value to set + * @return the JobStages object itself. + */ + public JobStages withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStatus.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStatus.java new file mode 100644 index 000000000000..3a5a1b98a6e9 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/JobStatus.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobStatus. + */ +public enum JobStatus { + /** Enum value None. */ + NONE("None"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value WaitingForAction. */ + WAITING_FOR_ACTION("WaitingForAction"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Cancelling. */ + CANCELLING("Cancelling"); + + /** The actual serialized value for a JobStatus instance. */ + private String value; + + JobStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed JobStatus object, or null if unable to parse. + */ + @JsonCreator + public static JobStatus fromString(String value) { + JobStatus[] items = JobStatus.values(); + for (JobStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Key.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Key.java new file mode 100644 index 000000000000..cb5419186b00 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Key.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Encryption Key. + */ +public class Key { + /** + * Modulus of the encryption key. + */ + @JsonProperty(value = "keyModulus", required = true) + private String keyModulus; + + /** + * Exponent of the encryption key. + */ + @JsonProperty(value = "keyExponent", required = true) + private String keyExponent; + + /** + * The maximum byte size that can be encrypted by the key. For a key size + * larger than the size, break into chunks and encrypt each chunk, append + * each encrypted chunk with : to mark the end of the chunk. + */ + @JsonProperty(value = "encryptionChunkSizeInBytes", required = true) + private int encryptionChunkSizeInBytes; + + /** + * Get modulus of the encryption key. + * + * @return the keyModulus value + */ + public String keyModulus() { + return this.keyModulus; + } + + /** + * Set modulus of the encryption key. + * + * @param keyModulus the keyModulus value to set + * @return the Key object itself. + */ + public Key withKeyModulus(String keyModulus) { + this.keyModulus = keyModulus; + return this; + } + + /** + * Get exponent of the encryption key. + * + * @return the keyExponent value + */ + public String keyExponent() { + return this.keyExponent; + } + + /** + * Set exponent of the encryption key. + * + * @param keyExponent the keyExponent value to set + * @return the Key object itself. + */ + public Key withKeyExponent(String keyExponent) { + this.keyExponent = keyExponent; + return this; + } + + /** + * Get the maximum byte size that can be encrypted by the key. For a key size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark the end of the chunk. + * + * @return the encryptionChunkSizeInBytes value + */ + public int encryptionChunkSizeInBytes() { + return this.encryptionChunkSizeInBytes; + } + + /** + * Set the maximum byte size that can be encrypted by the key. For a key size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark the end of the chunk. + * + * @param encryptionChunkSizeInBytes the encryptionChunkSizeInBytes value to set + * @return the Key object itself. + */ + public Key withEncryptionChunkSizeInBytes(int encryptionChunkSizeInBytes) { + this.encryptionChunkSizeInBytes = encryptionChunkSizeInBytes; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunLocation.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunLocation.java new file mode 100644 index 000000000000..2600fa1668c0 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunLocation.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RunLocation. + */ +public enum RunLocation { + /** Enum value none. */ + NONE("none"), + + /** Enum value australiaeast. */ + AUSTRALIAEAST("australiaeast"), + + /** Enum value australiasoutheast. */ + AUSTRALIASOUTHEAST("australiasoutheast"), + + /** Enum value brazilsouth. */ + BRAZILSOUTH("brazilsouth"), + + /** Enum value canadacentral. */ + CANADACENTRAL("canadacentral"), + + /** Enum value canadaeast. */ + CANADAEAST("canadaeast"), + + /** Enum value centralindia. */ + CENTRALINDIA("centralindia"), + + /** Enum value centralus. */ + CENTRALUS("centralus"), + + /** Enum value eastasia. */ + EASTASIA("eastasia"), + + /** Enum value eastus. */ + EASTUS("eastus"), + + /** Enum value eastus2. */ + EASTUS2("eastus2"), + + /** Enum value japaneast. */ + JAPANEAST("japaneast"), + + /** Enum value japanwest. */ + JAPANWEST("japanwest"), + + /** Enum value koreacentral. */ + KOREACENTRAL("koreacentral"), + + /** Enum value koreasouth. */ + KOREASOUTH("koreasouth"), + + /** Enum value southeastasia. */ + SOUTHEASTASIA("southeastasia"), + + /** Enum value southcentralus. */ + SOUTHCENTRALUS("southcentralus"), + + /** Enum value southindia. */ + SOUTHINDIA("southindia"), + + /** Enum value northcentralus. */ + NORTHCENTRALUS("northcentralus"), + + /** Enum value northeurope. */ + NORTHEUROPE("northeurope"), + + /** Enum value uksouth. */ + UKSOUTH("uksouth"), + + /** Enum value ukwest. */ + UKWEST("ukwest"), + + /** Enum value westcentralus. */ + WESTCENTRALUS("westcentralus"), + + /** Enum value westeurope. */ + WESTEUROPE("westeurope"), + + /** Enum value westindia. */ + WESTINDIA("westindia"), + + /** Enum value westus. */ + WESTUS("westus"), + + /** Enum value westus2. */ + WESTUS2("westus2"); + + /** The actual serialized value for a RunLocation instance. */ + private String value; + + RunLocation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RunLocation instance. + * + * @param value the serialized value to parse. + * @return the parsed RunLocation object, or null if unable to parse. + */ + @JsonCreator + public static RunLocation fromString(String value) { + RunLocation[] items = RunLocation.values(); + for (RunLocation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunParameters.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunParameters.java new file mode 100644 index 000000000000..26c0a42670e1 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/RunParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Run parameters for a job. + */ +public class RunParameters { + /** + * Enum to detect if user confirmation is required. If not passed will + * default to NotRequired. Possible values include: 'NotRequired', + * 'Required'. + */ + @JsonProperty(value = "userConfirmation") + private UserConfirmation userConfirmation; + + /** + * A generic json used differently by each data service type. + */ + @JsonProperty(value = "dataServiceInput") + private Object dataServiceInput; + + /** + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "customerSecrets") + private List customerSecrets; + + /** + * Get enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'. + * + * @return the userConfirmation value + */ + public UserConfirmation userConfirmation() { + return this.userConfirmation; + } + + /** + * Set enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'. + * + * @param userConfirmation the userConfirmation value to set + * @return the RunParameters object itself. + */ + public RunParameters withUserConfirmation(UserConfirmation userConfirmation) { + this.userConfirmation = userConfirmation; + return this; + } + + /** + * Get a generic json used differently by each data service type. + * + * @return the dataServiceInput value + */ + public Object dataServiceInput() { + return this.dataServiceInput; + } + + /** + * Set a generic json used differently by each data service type. + * + * @param dataServiceInput the dataServiceInput value to set + * @return the RunParameters object itself. + */ + public RunParameters withDataServiceInput(Object dataServiceInput) { + this.dataServiceInput = dataServiceInput; + return this; + } + + /** + * Get list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @return the customerSecrets value + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set + * @return the RunParameters object itself. + */ + public RunParameters withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Schedule.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Schedule.java new file mode 100644 index 000000000000..876e26665e48 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Schedule.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.hybriddata; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schedule for the job run. + */ +public class Schedule { + /** + * Name of the schedule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A list of repetition intervals in ISO 8601 format. + */ + @JsonProperty(value = "policyList") + private List policyList; + + /** + * Get name of the schedule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the schedule. + * + * @param name the name value to set + * @return the Schedule object itself. + */ + public Schedule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a list of repetition intervals in ISO 8601 format. + * + * @return the policyList value + */ + public List policyList() { + return this.policyList; + } + + /** + * Set a list of repetition intervals in ISO 8601 format. + * + * @param policyList the policyList value to set + * @return the Schedule object itself. + */ + public Schedule withPolicyList(List policyList) { + this.policyList = policyList; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Sku.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Sku.java new file mode 100644 index 000000000000..b1e10dbe0d95 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/Sku.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The sku type. + */ +public class Sku { + /** + * The sku name. Required for data manager creation, optional for update. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The sku tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the sku name. Required for data manager creation, optional for update. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the sku name. Required for data manager creation, optional for update. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sku tier. This is based on the SKU name. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the sku tier. This is based on the SKU name. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/State.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/State.java new file mode 100644 index 000000000000..562d6bd0c86e --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/State.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for State. + */ +public enum State { + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Supported. */ + SUPPORTED("Supported"); + + /** The actual serialized value for a State instance. */ + private String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/SupportedAlgorithm.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/SupportedAlgorithm.java new file mode 100644 index 000000000000..2ff2568376d6 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/SupportedAlgorithm.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SupportedAlgorithm. + */ +public enum SupportedAlgorithm { + /** Enum value None. */ + NONE("None"), + + /** Enum value RSA1_5. */ + RSA1_5("RSA1_5"), + + /** Enum value RSA_OAEP. */ + RSA_OAEP("RSA_OAEP"), + + /** Enum value PlainText. */ + PLAIN_TEXT("PlainText"); + + /** The actual serialized value for a SupportedAlgorithm instance. */ + private String value; + + SupportedAlgorithm(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SupportedAlgorithm instance. + * + * @param value the serialized value to parse. + * @return the parsed SupportedAlgorithm object, or null if unable to parse. + */ + @JsonCreator + public static SupportedAlgorithm fromString(String value) { + SupportedAlgorithm[] items = SupportedAlgorithm.values(); + for (SupportedAlgorithm item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/UserConfirmation.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/UserConfirmation.java new file mode 100644 index 000000000000..31e1e39bfb57 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/UserConfirmation.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.hybriddata; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UserConfirmation. + */ +public enum UserConfirmation { + /** Enum value NotRequired. */ + NOT_REQUIRED("NotRequired"), + + /** Enum value Required. */ + REQUIRED("Required"); + + /** The actual serialized value for a UserConfirmation instance. */ + private String value; + + UserConfirmation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UserConfirmation instance. + * + * @param value the serialized value to parse. + * @return the parsed UserConfirmation object, or null if unable to parse. + */ + @JsonCreator + public static UserConfirmation fromString(String value) { + UserConfirmation[] items = UserConfirmation.values(); + for (UserConfirmation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/AvailableProviderOperationInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/AvailableProviderOperationInner.java new file mode 100644 index 000000000000..745f45bdc2ad --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/AvailableProviderOperationInner.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.AvailableProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class represents provider operation. + */ +public class AvailableProviderOperationInner { + /** + * Gets or Sets Name of the operations. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Gets or sets Display information + * Contains the localized display information for this particular + * operation/action. + */ + @JsonProperty(value = "display") + private AvailableProviderOperationDisplay display; + + /** + * Gets or sets Origin + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. + * Default value is “user,system”. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Gets or sets Properties + * Reserved for future use. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get gets or Sets Name of the operations. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or Sets Name of the operations. + * + * @param name the name value to set + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets Display information + Contains the localized display information for this particular operation/action. + * + * @return the display value + */ + public AvailableProviderOperationDisplay display() { + return this.display; + } + + /** + * Set gets or sets Display information + Contains the localized display information for this particular operation/action. + * + * @param display the display value to set + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withDisplay(AvailableProviderOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get gets or sets Origin + The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + Default value is “user,system”. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set gets or sets Origin + The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + Default value is “user,system”. + * + * @param origin the origin value to set + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get gets or sets Properties + Reserved for future use. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set gets or sets Properties + Reserved for future use. + * + * @param properties the properties value to set + * @return the AvailableProviderOperationInner object itself. + */ + public AvailableProviderOperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagerInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagerInner.java new file mode 100644 index 000000000000..104923c71d6a --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagerInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The DataManager resource. + */ +public class DataManagerInner extends Resource { + /** + * Etag of the Resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The sku type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get etag of the Resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set etag of the Resource. + * + * @param etag the etag value to set + * @return the DataManagerInner object itself. + */ + public DataManagerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the sku type. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku type. + * + * @param sku the sku value to set + * @return the DataManagerInner object itself. + */ + public DataManagerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagersInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagersInner.java new file mode 100644 index 000000000000..b2deed22b4fb --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataManagersInner.java @@ -0,0 +1,1038 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.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.hybriddata.DataManagerUpdateParameter; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 DataManagers. + */ +public class DataManagersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DataManagersService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataManagersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataManagersInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(DataManagersService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataManagers to be + * used by Retrofit to perform actually REST calls. + */ + interface DataManagersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.DataManagers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.DataManagers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers") + 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.hybriddata.DataManagers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataManagers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Body DataManagerInner dataManager, @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.hybriddata.DataManagers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Body DataManagerInner dataManager, @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.hybriddata.DataManagers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataManagers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataManagers update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Body DataManagerUpdateParameter dataManagerUpdateParameter, @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.hybriddata.DataManagers beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Body DataManagerUpdateParameter dataManagerUpdateParameter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the data manager resources available under the 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; + } + }; + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @return the observable to the List<DataManagerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the data manager resources available under the subscription. + * + * @return the observable to the List<DataManagerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @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; + } + }; + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @return the observable to the List<DataManagerInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the data manager resources available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @return the observable to the List<DataManagerInner> object + */ + public Observable>> 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>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 DataManagerInner object if successful. + */ + public DataManagerInner getByResourceGroup(String resourceGroupName, String dataManagerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String dataManagerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dataManagerName).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner create(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return createWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager).toBlocking().last().body(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @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 dataManagerName, DataManagerInner dataManager, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager), serviceCallback); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return createWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManager == null) { + throw new IllegalArgumentException("Parameter dataManager is required and cannot be null."); + } + Validator.validate(dataManager); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), dataManager, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner beginCreate(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return beginCreateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager).toBlocking().single().body(); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @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 dataManagerName, DataManagerInner dataManager, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager), serviceCallback); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + return beginCreateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManager).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource API. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManager Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerInner dataManager) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManager == null) { + throw new IllegalArgumentException("Parameter dataManager is required and cannot be null."); + } + Validator.validate(dataManager); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), dataManager, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String dataManagerName) { + deleteWithServiceResponseAsync(resourceGroupName, dataManagerName).toBlocking().last().body(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String dataManagerName) { + return deleteWithServiceResponseAsync(resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String dataManagerName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String dataManagerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a data manager resource in Microsoft Azure. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner update(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + return updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter).toBlocking().last().body(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @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 dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter), serviceCallback); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + return updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManagerUpdateParameter == null) { + throw new IllegalArgumentException("Parameter dataManagerUpdateParameter is required and cannot be null."); + } + Validator.validate(dataManagerUpdateParameter); + final String ifMatch = null; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), ifMatch, dataManagerUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner update(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).toBlocking().last().body(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @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 dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManagerUpdateParameter == null) { + throw new IllegalArgumentException("Parameter dataManagerUpdateParameter is required and cannot be null."); + } + Validator.validate(dataManagerUpdateParameter); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), ifMatch, dataManagerUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner beginUpdate(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @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 dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter), serviceCallback); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManagerUpdateParameter == null) { + throw new IllegalArgumentException("Parameter dataManagerUpdateParameter is required and cannot be null."); + } + Validator.validate(dataManagerUpdateParameter); + final String ifMatch = null; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), ifMatch, dataManagerUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @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 DataManagerInner object if successful. + */ + public DataManagerInner beginUpdate(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @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 dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, dataManagerName, dataManagerUpdateParameter, ifMatch).map(new Func1, DataManagerInner>() { + @Override + public DataManagerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataManagerUpdateParameter Data manager resource details from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataManagerInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String dataManagerName, DataManagerUpdateParameter dataManagerUpdateParameter, String ifMatch) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 (dataManagerUpdateParameter == null) { + throw new IllegalArgumentException("Parameter dataManagerUpdateParameter is required and cannot be null."); + } + Validator.validate(dataManagerUpdateParameter); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), ifMatch, dataManagerUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServiceInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServiceInner.java new file mode 100644 index 000000000000..528fc0656ec0 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServiceInner.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.State; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Data Service. + */ +@JsonFlatten +public class DataServiceInner extends DmsBaseObject { + /** + * State of the data service. Possible values include: 'Disabled', + * 'Enabled', 'Supported'. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /** + * Supported data store types which can be used as a sink. + */ + @JsonProperty(value = "properties.supportedDataSinkTypes") + private List supportedDataSinkTypes; + + /** + * Supported data store types which can be used as a source. + */ + @JsonProperty(value = "properties.supportedDataSourceTypes") + private List supportedDataSourceTypes; + + /** + * Get state of the data service. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set state of the data service. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @param state the state value to set + * @return the DataServiceInner object itself. + */ + public DataServiceInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get supported data store types which can be used as a sink. + * + * @return the supportedDataSinkTypes value + */ + public List supportedDataSinkTypes() { + return this.supportedDataSinkTypes; + } + + /** + * Set supported data store types which can be used as a sink. + * + * @param supportedDataSinkTypes the supportedDataSinkTypes value to set + * @return the DataServiceInner object itself. + */ + public DataServiceInner withSupportedDataSinkTypes(List supportedDataSinkTypes) { + this.supportedDataSinkTypes = supportedDataSinkTypes; + return this; + } + + /** + * Get supported data store types which can be used as a source. + * + * @return the supportedDataSourceTypes value + */ + public List supportedDataSourceTypes() { + return this.supportedDataSourceTypes; + } + + /** + * Set supported data store types which can be used as a source. + * + * @param supportedDataSourceTypes the supportedDataSourceTypes value to set + * @return the DataServiceInner object itself. + */ + public DataServiceInner withSupportedDataSourceTypes(List supportedDataSourceTypes) { + this.supportedDataSourceTypes = supportedDataSourceTypes; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServicesInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServicesInner.java new file mode 100644 index 000000000000..7b0574292441 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataServicesInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 DataServices. + */ +public class DataServicesInner { + /** The Retrofit service to perform REST calls. */ + private DataServicesService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataServicesInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(DataServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataServices to be + * used by Retrofit to perform actually REST calls. + */ + interface DataServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.DataServices listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataServices get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}") + Observable> get(@Path("dataServiceName") String dataServiceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataServices listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataServiceInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataServiceInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the data services. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataServiceInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the data services. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the data service that match the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 DataServiceInner object if successful. + */ + public DataServiceInner get(String dataServiceName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Gets the data service that match the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataServiceName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Gets the data service that match the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataServiceInner object + */ + public Observable getAsync(String dataServiceName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName).map(new Func1, DataServiceInner>() { + @Override + public DataServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the data service that match the data service name given. + * + * @param dataServiceName The name of the data service that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataServiceInner object + */ + public Observable> getWithServiceResponseAsync(String dataServiceName, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataServiceName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the data services. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataServiceInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the data services. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the data services. + * + * @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<DataServiceInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the data services. + * + * @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<DataServiceInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the data services. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreInner.java new file mode 100644 index 000000000000..0db638b145e6 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreInner.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.State; +import java.util.List; +import com.microsoft.azure.management.hybriddata.CustomerSecret; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Data store. + */ +@JsonFlatten +public class DataStoreInner extends DmsBaseObject { + /** + * Arm Id for the manager resource to which the data source is associated. + * This is optional. + */ + @JsonProperty(value = "properties.repositoryId") + private String repositoryId; + + /** + * State of the data source. Possible values include: 'Disabled', + * 'Enabled', 'Supported'. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /** + * A generic json used differently by each data source type. + */ + @JsonProperty(value = "properties.extendedProperties") + private Object extendedProperties; + + /** + * The arm id of the data store type. + */ + @JsonProperty(value = "properties.dataStoreTypeId", required = true) + private String dataStoreTypeId; + + /** + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "properties.customerSecrets") + private List customerSecrets; + + /** + * Get arm Id for the manager resource to which the data source is associated. This is optional. + * + * @return the repositoryId value + */ + public String repositoryId() { + return this.repositoryId; + } + + /** + * Set arm Id for the manager resource to which the data source is associated. This is optional. + * + * @param repositoryId the repositoryId value to set + * @return the DataStoreInner object itself. + */ + public DataStoreInner withRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * Get state of the data source. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set state of the data source. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @param state the state value to set + * @return the DataStoreInner object itself. + */ + public DataStoreInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get a generic json used differently by each data source type. + * + * @return the extendedProperties value + */ + public Object extendedProperties() { + return this.extendedProperties; + } + + /** + * Set a generic json used differently by each data source type. + * + * @param extendedProperties the extendedProperties value to set + * @return the DataStoreInner object itself. + */ + public DataStoreInner withExtendedProperties(Object extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the arm id of the data store type. + * + * @return the dataStoreTypeId value + */ + public String dataStoreTypeId() { + return this.dataStoreTypeId; + } + + /** + * Set the arm id of the data store type. + * + * @param dataStoreTypeId the dataStoreTypeId value to set + * @return the DataStoreInner object itself. + */ + public DataStoreInner withDataStoreTypeId(String dataStoreTypeId) { + this.dataStoreTypeId = dataStoreTypeId; + return this; + } + + /** + * Get list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @return the customerSecrets value + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set + * @return the DataStoreInner object itself. + */ + public DataStoreInner withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypeInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypeInner.java new file mode 100644 index 000000000000..f2bcf113133c --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypeInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.State; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Data Store Type. + */ +@JsonFlatten +public class DataStoreTypeInner extends DmsBaseObject { + /** + * Arm type for the manager resource to which the data source type is + * associated. This is optional. + */ + @JsonProperty(value = "properties.repositoryType") + private String repositoryType; + + /** + * State of the data store type. Possible values include: 'Disabled', + * 'Enabled', 'Supported'. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /** + * Supported data services where it can be used as a sink. + */ + @JsonProperty(value = "properties.supportedDataServicesAsSink") + private List supportedDataServicesAsSink; + + /** + * Supported data services where it can be used as a source. + */ + @JsonProperty(value = "properties.supportedDataServicesAsSource") + private List supportedDataServicesAsSource; + + /** + * Get arm type for the manager resource to which the data source type is associated. This is optional. + * + * @return the repositoryType value + */ + public String repositoryType() { + return this.repositoryType; + } + + /** + * Set arm type for the manager resource to which the data source type is associated. This is optional. + * + * @param repositoryType the repositoryType value to set + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withRepositoryType(String repositoryType) { + this.repositoryType = repositoryType; + return this; + } + + /** + * Get state of the data store type. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set state of the data store type. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @param state the state value to set + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get supported data services where it can be used as a sink. + * + * @return the supportedDataServicesAsSink value + */ + public List supportedDataServicesAsSink() { + return this.supportedDataServicesAsSink; + } + + /** + * Set supported data services where it can be used as a sink. + * + * @param supportedDataServicesAsSink the supportedDataServicesAsSink value to set + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withSupportedDataServicesAsSink(List supportedDataServicesAsSink) { + this.supportedDataServicesAsSink = supportedDataServicesAsSink; + return this; + } + + /** + * Get supported data services where it can be used as a source. + * + * @return the supportedDataServicesAsSource value + */ + public List supportedDataServicesAsSource() { + return this.supportedDataServicesAsSource; + } + + /** + * Set supported data services where it can be used as a source. + * + * @param supportedDataServicesAsSource the supportedDataServicesAsSource value to set + * @return the DataStoreTypeInner object itself. + */ + public DataStoreTypeInner withSupportedDataServicesAsSource(List supportedDataServicesAsSource) { + this.supportedDataServicesAsSource = supportedDataServicesAsSource; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypesInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypesInner.java new file mode 100644 index 000000000000..75ce5c64762c --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoreTypesInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 DataStoreTypes. + */ +public class DataStoreTypesInner { + /** The Retrofit service to perform REST calls. */ + private DataStoreTypesService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataStoreTypesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataStoreTypesInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(DataStoreTypesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataStoreTypes to be + * used by Retrofit to perform actually REST calls. + */ + interface DataStoreTypesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.DataStoreTypes listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataStoreTypes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName}") + Observable> get(@Path("dataStoreTypeName") String dataStoreTypeName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataStoreTypes listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataStoreTypeInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreTypeInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreTypeInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataStoreTypeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 DataStoreTypeInner object if successful. + */ + public DataStoreTypeInner get(String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataStoreTypeName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataStoreTypeName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataStoreTypeName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreTypeInner object + */ + public Observable getAsync(String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataStoreTypeName, resourceGroupName, dataManagerName).map(new Func1, DataStoreTypeInner>() { + @Override + public DataStoreTypeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the data store/repository type given its name. + * + * @param dataStoreTypeName The data store/repository type name for which details are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreTypeInner object + */ + public Observable> getWithServiceResponseAsync(String dataStoreTypeName, String resourceGroupName, String dataManagerName) { + if (dataStoreTypeName == null) { + throw new IllegalArgumentException("Parameter dataStoreTypeName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataStoreTypeName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataStoreTypeInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @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<DataStoreTypeInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + * @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<DataStoreTypeInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data store/repository types that the resource supports. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataStoreTypeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoresInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoresInner.java new file mode 100644 index 000000000000..4f8b9cae2a0e --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/DataStoresInner.java @@ -0,0 +1,897 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataStores. + */ +public class DataStoresInner { + /** The Retrofit service to perform REST calls. */ + private DataStoresService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of DataStoresInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataStoresInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(DataStoresService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataStores to be + * used by Retrofit to perform actually REST calls. + */ + interface DataStoresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.DataStores listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.DataStores get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + Observable> get(@Path("dataStoreName") String dataStoreName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataStores createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + Observable> createOrUpdate(@Path("dataStoreName") String dataStoreName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body DataStoreInner dataStore, @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.hybriddata.DataStores beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}") + Observable> beginCreateOrUpdate(@Path("dataStoreName") String dataStoreName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body DataStoreInner dataStore, @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.hybriddata.DataStores delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("dataStoreName") String dataStoreName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataStores beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("dataStoreName") String dataStoreName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.DataStores listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataStoreInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataStoreInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataStoreInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 DataStoreInner object if successful. + */ + public DataStoreInner get(String dataStoreName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataStoreName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreInner object + */ + public Observable getAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).map(new Func1, DataStoreInner>() { + @Override + public DataStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method gets the data store/repository by name. + * + * @param dataStoreName The data store/repository name queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreInner object + */ + public Observable> getWithServiceResponseAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + if (dataStoreName == null) { + throw new IllegalArgumentException("Parameter dataStoreName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataStoreName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @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 DataStoreInner object if successful. + */ + public DataStoreInner createOrUpdate(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return createOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).toBlocking().last().body(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore), serviceCallback); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return createOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).map(new Func1, DataStoreInner>() { + @Override + public DataStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + if (dataStoreName == null) { + throw new IllegalArgumentException("Parameter dataStoreName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (dataStore == null) { + throw new IllegalArgumentException("Parameter dataStore 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(dataStore); + Observable> observable = service.createOrUpdate(dataStoreName, this.client.subscriptionId(), resourceGroupName, dataManagerName, dataStore, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @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 DataStoreInner object if successful. + */ + public DataStoreInner beginCreateOrUpdate(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return beginCreateOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).toBlocking().single().body(); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @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 beginCreateOrUpdateAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore), serviceCallback); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreInner object + */ + public Observable beginCreateOrUpdateAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + return beginCreateOrUpdateWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName, dataStore).map(new Func1, DataStoreInner>() { + @Override + public DataStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the data store/repository in the data manager. + * + * @param dataStoreName The data store/repository name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param dataStore The data store/repository object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataStoreInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String dataStoreName, String resourceGroupName, String dataManagerName, DataStoreInner dataStore) { + if (dataStoreName == null) { + throw new IllegalArgumentException("Parameter dataStoreName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (dataStore == null) { + throw new IllegalArgumentException("Parameter dataStore 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(dataStore); + return service.beginCreateOrUpdate(dataStoreName, this.client.subscriptionId(), resourceGroupName, dataManagerName, dataStore, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String dataStoreName, String resourceGroupName, String dataManagerName) { + deleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).toBlocking().last().body(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataStoreName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + return deleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + if (dataStoreName == null) { + throw new IllegalArgumentException("Parameter dataStoreName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataStoreName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String dataStoreName, String resourceGroupName, String dataManagerName) { + beginDeleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataStoreName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + return beginDeleteWithServiceResponseAsync(dataStoreName, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method deletes the given data store/repository. + * + * @param dataStoreName The data store/repository name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String dataStoreName, String resourceGroupName, String dataManagerName) { + if (dataStoreName == null) { + throw new IllegalArgumentException("Parameter dataStoreName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataStoreName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataStoreInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @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<DataStoreInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + * @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<DataStoreInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data stores/repositories in the given resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/HybridDataManagementClientImpl.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/HybridDataManagementClientImpl.java new file mode 100644 index 000000000000..2c535efb9613 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/HybridDataManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.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 HybridDataManagementClientImpl class. + */ +public class HybridDataManagementClientImpl 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. */ + private String apiVersion; + + /** + * Gets The API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The Subscription Id. */ + private String subscriptionId; + + /** + * Gets The Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HybridDataManagementClientImpl 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 HybridDataManagementClientImpl 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 HybridDataManagementClientImpl 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 HybridDataManagementClientImpl 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 DataManagersInner object to access its operations. + */ + private DataManagersInner dataManagers; + + /** + * Gets the DataManagersInner object to access its operations. + * @return the DataManagersInner object. + */ + public DataManagersInner dataManagers() { + return this.dataManagers; + } + + /** + * The DataServicesInner object to access its operations. + */ + private DataServicesInner dataServices; + + /** + * Gets the DataServicesInner object to access its operations. + * @return the DataServicesInner object. + */ + public DataServicesInner dataServices() { + return this.dataServices; + } + + /** + * The JobDefinitionsInner object to access its operations. + */ + private JobDefinitionsInner jobDefinitions; + + /** + * Gets the JobDefinitionsInner object to access its operations. + * @return the JobDefinitionsInner object. + */ + public JobDefinitionsInner jobDefinitions() { + return this.jobDefinitions; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The DataStoresInner object to access its operations. + */ + private DataStoresInner dataStores; + + /** + * Gets the DataStoresInner object to access its operations. + * @return the DataStoresInner object. + */ + public DataStoresInner dataStores() { + return this.dataStores; + } + + /** + * The DataStoreTypesInner object to access its operations. + */ + private DataStoreTypesInner dataStoreTypes; + + /** + * Gets the DataStoreTypesInner object to access its operations. + * @return the DataStoreTypesInner object. + */ + public DataStoreTypesInner dataStoreTypes() { + return this.dataStoreTypes; + } + + /** + * The PublicKeysInner object to access its operations. + */ + private PublicKeysInner publicKeys; + + /** + * Gets the PublicKeysInner object to access its operations. + * @return the PublicKeysInner object. + */ + public PublicKeysInner publicKeys() { + return this.publicKeys; + } + + /** + * Initializes an instance of HybridDataManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HybridDataManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HybridDataManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HybridDataManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HybridDataManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HybridDataManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-06-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.dataManagers = new DataManagersInner(restClient().retrofit(), this); + this.dataServices = new DataServicesInner(restClient().retrofit(), this); + this.jobDefinitions = new JobDefinitionsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.dataStores = new DataStoresInner(restClient().retrofit(), this); + this.dataStoreTypes = new DataStoreTypesInner(restClient().retrofit(), this); + this.publicKeys = new PublicKeysInner(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(), "HybridDataManagementClient", "2016-06-01"); + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionInner.java new file mode 100644 index 000000000000..2ea378e453db --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionInner.java @@ -0,0 +1,272 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import java.util.List; +import com.microsoft.azure.management.hybriddata.Schedule; +import com.microsoft.azure.management.hybriddata.State; +import org.joda.time.DateTime; +import com.microsoft.azure.management.hybriddata.RunLocation; +import com.microsoft.azure.management.hybriddata.UserConfirmation; +import com.microsoft.azure.management.hybriddata.CustomerSecret; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Job Definition. + */ +@JsonFlatten +public class JobDefinitionInner extends DmsBaseObject { + /** + * Data Source Id associated to the job definition. + */ + @JsonProperty(value = "properties.dataSourceId", required = true) + private String dataSourceId; + + /** + * Data Sink Id associated to the job definition. + */ + @JsonProperty(value = "properties.dataSinkId", required = true) + private String dataSinkId; + + /** + * Schedule for running the job definition. + */ + @JsonProperty(value = "properties.schedules") + private List schedules; + + /** + * State of the job definition. Possible values include: 'Disabled', + * 'Enabled', 'Supported'. + */ + @JsonProperty(value = "properties.state", required = true) + private State state; + + /** + * Last modified time of the job definition. + */ + @JsonProperty(value = "properties.lastModifiedTime") + private DateTime lastModifiedTime; + + /** + * This is the preferred geo location for the job to run. Possible values + * include: 'none', 'australiaeast', 'australiasoutheast', 'brazilsouth', + * 'canadacentral', 'canadaeast', 'centralindia', 'centralus', 'eastasia', + * 'eastus', 'eastus2', 'japaneast', 'japanwest', 'koreacentral', + * 'koreasouth', 'southeastasia', 'southcentralus', 'southindia', + * 'northcentralus', 'northeurope', 'uksouth', 'ukwest', 'westcentralus', + * 'westeurope', 'westindia', 'westus', 'westus2'. + */ + @JsonProperty(value = "properties.runLocation") + private RunLocation runLocation; + + /** + * Enum to detect if user confirmation is required. If not passed will + * default to NotRequired. Possible values include: 'NotRequired', + * 'Required'. + */ + @JsonProperty(value = "properties.userConfirmation") + private UserConfirmation userConfirmation; + + /** + * A generic json used differently by each data service type. + */ + @JsonProperty(value = "properties.dataServiceInput") + private Object dataServiceInput; + + /** + * List of customer secrets containing a key identifier and key value. The + * key identifier is a way for the specific data source to understand the + * key. Value contains customer secret encrypted by the encryptionKeys. + */ + @JsonProperty(value = "properties.customerSecrets") + private List customerSecrets; + + /** + * Get data Source Id associated to the job definition. + * + * @return the dataSourceId value + */ + public String dataSourceId() { + return this.dataSourceId; + } + + /** + * Set data Source Id associated to the job definition. + * + * @param dataSourceId the dataSourceId value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataSourceId(String dataSourceId) { + this.dataSourceId = dataSourceId; + return this; + } + + /** + * Get data Sink Id associated to the job definition. + * + * @return the dataSinkId value + */ + public String dataSinkId() { + return this.dataSinkId; + } + + /** + * Set data Sink Id associated to the job definition. + * + * @param dataSinkId the dataSinkId value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataSinkId(String dataSinkId) { + this.dataSinkId = dataSinkId; + return this; + } + + /** + * Get schedule for running the job definition. + * + * @return the schedules value + */ + public List schedules() { + return this.schedules; + } + + /** + * Set schedule for running the job definition. + * + * @param schedules the schedules value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withSchedules(List schedules) { + this.schedules = schedules; + return this; + } + + /** + * Get state of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set state of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'. + * + * @param state the state value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get last modified time of the job definition. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set last modified time of the job definition. + * + * @param lastModifiedTime the lastModifiedTime value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withLastModifiedTime(DateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * Get this is the preferred geo location for the job to run. Possible values include: 'none', 'australiaeast', 'australiasoutheast', 'brazilsouth', 'canadacentral', 'canadaeast', 'centralindia', 'centralus', 'eastasia', 'eastus', 'eastus2', 'japaneast', 'japanwest', 'koreacentral', 'koreasouth', 'southeastasia', 'southcentralus', 'southindia', 'northcentralus', 'northeurope', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2'. + * + * @return the runLocation value + */ + public RunLocation runLocation() { + return this.runLocation; + } + + /** + * Set this is the preferred geo location for the job to run. Possible values include: 'none', 'australiaeast', 'australiasoutheast', 'brazilsouth', 'canadacentral', 'canadaeast', 'centralindia', 'centralus', 'eastasia', 'eastus', 'eastus2', 'japaneast', 'japanwest', 'koreacentral', 'koreasouth', 'southeastasia', 'southcentralus', 'southindia', 'northcentralus', 'northeurope', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2'. + * + * @param runLocation the runLocation value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withRunLocation(RunLocation runLocation) { + this.runLocation = runLocation; + return this; + } + + /** + * Get enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'. + * + * @return the userConfirmation value + */ + public UserConfirmation userConfirmation() { + return this.userConfirmation; + } + + /** + * Set enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'. + * + * @param userConfirmation the userConfirmation value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withUserConfirmation(UserConfirmation userConfirmation) { + this.userConfirmation = userConfirmation; + return this; + } + + /** + * Get a generic json used differently by each data service type. + * + * @return the dataServiceInput value + */ + public Object dataServiceInput() { + return this.dataServiceInput; + } + + /** + * Set a generic json used differently by each data service type. + * + * @param dataServiceInput the dataServiceInput value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withDataServiceInput(Object dataServiceInput) { + this.dataServiceInput = dataServiceInput; + return this; + } + + /** + * Get list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @return the customerSecrets value + */ + public List customerSecrets() { + return this.customerSecrets; + } + + /** + * Set list of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. + * + * @param customerSecrets the customerSecrets value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withCustomerSecrets(List customerSecrets) { + this.customerSecrets = customerSecrets; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionsInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionsInner.java new file mode 100644 index 000000000000..33dee0ca91ea --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobDefinitionsInner.java @@ -0,0 +1,1520 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hybriddata.RunParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in JobDefinitions. + */ +public class JobDefinitionsInner { + /** The Retrofit service to perform REST calls. */ + private JobDefinitionsService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of JobDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobDefinitionsInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(JobDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface JobDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.JobDefinitions listByDataService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions") + Observable> listByDataService(@Path("dataServiceName") String dataServiceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.JobDefinitions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + Observable> get(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.JobDefinitions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + Observable> createOrUpdate(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body JobDefinitionInner jobDefinition, @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.hybriddata.JobDefinitions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}") + Observable> beginCreateOrUpdate(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body JobDefinitionInner jobDefinition, @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.hybriddata.JobDefinitions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.JobDefinitions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.JobDefinitions run" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/run") + Observable> run(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body RunParameters runParameters, @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.hybriddata.JobDefinitions beginRun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/run") + Observable> beginRun(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Body RunParameters runParameters, @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.hybriddata.JobDefinitions listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobDefinitions") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.JobDefinitions listByDataServiceNext" }) + @GET + Observable> listByDataServiceNext(@Url String nextUrl, @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.hybriddata.JobDefinitions listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataService(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + return listByDataServiceWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listByDataServiceWithServiceResponseAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + return listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceSinglePageAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByDataService(dataServiceName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataService(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataServiceWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param dataServiceName The data service type of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listByDataServiceWithServiceResponseAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + ServiceResponse> * @param dataServiceName The data service type of interest. + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceSinglePageAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataService(dataServiceName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner get(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable getAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method gets job definition object by name. + * + * @param dataServiceName The data service name of the job definition + * @param jobDefinitionName The job definition name that is being queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner createOrUpdate(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + return createOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition).toBlocking().last().body(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition), serviceCallback); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + return createOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (jobDefinition == null) { + throw new IllegalArgumentException("Parameter jobDefinition 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(jobDefinition); + Observable> observable = service.createOrUpdate(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, jobDefinition, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner beginCreateOrUpdate(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + return beginCreateOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition).toBlocking().single().body(); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @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 beginCreateOrUpdateAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition), serviceCallback); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable beginCreateOrUpdateAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + return beginCreateOrUpdateWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, jobDefinition).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be created or updated. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobDefinition Job Definition object to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, JobDefinitionInner jobDefinition) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (jobDefinition == null) { + throw new IllegalArgumentException("Parameter jobDefinition 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(jobDefinition); + return service.beginCreateOrUpdate(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, jobDefinition, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + deleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).toBlocking().last().body(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return deleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + beginDeleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + return beginDeleteWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method deletes the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName The job definition name to be deleted. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void run(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + runWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters).toBlocking().last().body(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @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 runAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(runWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters), serviceCallback); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable runAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + return runWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> runWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (runParameters == null) { + throw new IllegalArgumentException("Parameter runParameters 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(runParameters); + Observable> observable = service.run(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, runParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRun(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + beginRunWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters).toBlocking().single().body(); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @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 beginRunAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRunWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters), serviceCallback); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRunAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + return beginRunWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, runParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method runs a job instance of the given job definition. + * + * @param dataServiceName The data service type of the job definition. + * @param jobDefinitionName Name of the job definition. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param runParameters Run time parameters for the job definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRunWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String resourceGroupName, String dataManagerName, RunParameters runParameters) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName is required and cannot be null."); + } + if (runParameters == null) { + throw new IllegalArgumentException("Parameter runParameters 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(runParameters); + return service.beginRun(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, runParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRunDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRunDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataServiceNext(final String nextPageLink) { + ServiceResponse> response = listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @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> listByDataServiceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @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<JobDefinitionInner> object + */ + public Observable> listByDataServiceNextAsync(final String nextPageLink) { + return listByDataServiceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + * @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<JobDefinitionInner> object + */ + public Observable>> listByDataServiceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data service name. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceNextSinglePageAsync(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.listByDataServiceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataServiceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @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<JobDefinitionInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + * @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<JobDefinitionInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the job definitions of the given data manager resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobInner.java new file mode 100644 index 000000000000..692a853d54d8 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobInner.java @@ -0,0 +1,340 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.JobStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.hybriddata.IsJobCancellable; +import com.microsoft.azure.management.hybriddata.JobDetails; +import com.microsoft.azure.management.hybriddata.Error; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Data service job. + */ +@JsonFlatten +public class JobInner extends DmsBaseObject { + /** + * Status of the job. Possible values include: 'None', 'InProgress', + * 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + */ + @JsonProperty(value = "status", required = true) + private JobStatus status; + + /** + * Time at which the job was started in UTC ISO 8601 format. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * Time at which the job ended in UTC ISO 8601 format. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Describes whether the job is cancellable. Possible values include: + * 'NotCancellable', 'Cancellable'. + */ + @JsonProperty(value = "properties.isCancellable", required = true) + private IsJobCancellable isCancellable; + + /** + * Number of bytes processed by the job as of now. + */ + @JsonProperty(value = "properties.bytesProcessed") + private Long bytesProcessed; + + /** + * Number of items processed by the job as of now. + */ + @JsonProperty(value = "properties.itemsProcessed") + private Long itemsProcessed; + + /** + * Number of bytes to be processed by the job in total. + */ + @JsonProperty(value = "properties.totalBytesToProcess") + private Long totalBytesToProcess; + + /** + * Number of items to be processed by the job in total. + */ + @JsonProperty(value = "properties.totalItemsToProcess") + private Long totalItemsToProcess; + + /** + * Details of a job run. This field will only be sent for expand details + * filter. + */ + @JsonProperty(value = "properties.details") + private JobDetails details; + + /** + * Name of the data source on which the job was triggered. + */ + @JsonProperty(value = "properties.dataSourceName") + private String dataSourceName; + + /** + * Name of the data sink on which the job was triggered. + */ + @JsonProperty(value = "properties.dataSinkName") + private String dataSinkName; + + /** + * Top level error for the job. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + + /** + * Set status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling'. + * + * @param status the status value to set + * @return the JobInner object itself. + */ + public JobInner withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get time at which the job was started in UTC ISO 8601 format. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set time at which the job was started in UTC ISO 8601 format. + * + * @param startTime the startTime value to set + * @return the JobInner object itself. + */ + public JobInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get time at which the job ended in UTC ISO 8601 format. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set time at which the job ended in UTC ISO 8601 format. + * + * @param endTime the endTime value to set + * @return the JobInner object itself. + */ + public JobInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get describes whether the job is cancellable. Possible values include: 'NotCancellable', 'Cancellable'. + * + * @return the isCancellable value + */ + public IsJobCancellable isCancellable() { + return this.isCancellable; + } + + /** + * Set describes whether the job is cancellable. Possible values include: 'NotCancellable', 'Cancellable'. + * + * @param isCancellable the isCancellable value to set + * @return the JobInner object itself. + */ + public JobInner withIsCancellable(IsJobCancellable isCancellable) { + this.isCancellable = isCancellable; + return this; + } + + /** + * Get number of bytes processed by the job as of now. + * + * @return the bytesProcessed value + */ + public Long bytesProcessed() { + return this.bytesProcessed; + } + + /** + * Set number of bytes processed by the job as of now. + * + * @param bytesProcessed the bytesProcessed value to set + * @return the JobInner object itself. + */ + public JobInner withBytesProcessed(Long bytesProcessed) { + this.bytesProcessed = bytesProcessed; + return this; + } + + /** + * Get number of items processed by the job as of now. + * + * @return the itemsProcessed value + */ + public Long itemsProcessed() { + return this.itemsProcessed; + } + + /** + * Set number of items processed by the job as of now. + * + * @param itemsProcessed the itemsProcessed value to set + * @return the JobInner object itself. + */ + public JobInner withItemsProcessed(Long itemsProcessed) { + this.itemsProcessed = itemsProcessed; + return this; + } + + /** + * Get number of bytes to be processed by the job in total. + * + * @return the totalBytesToProcess value + */ + public Long totalBytesToProcess() { + return this.totalBytesToProcess; + } + + /** + * Set number of bytes to be processed by the job in total. + * + * @param totalBytesToProcess the totalBytesToProcess value to set + * @return the JobInner object itself. + */ + public JobInner withTotalBytesToProcess(Long totalBytesToProcess) { + this.totalBytesToProcess = totalBytesToProcess; + return this; + } + + /** + * Get number of items to be processed by the job in total. + * + * @return the totalItemsToProcess value + */ + public Long totalItemsToProcess() { + return this.totalItemsToProcess; + } + + /** + * Set number of items to be processed by the job in total. + * + * @param totalItemsToProcess the totalItemsToProcess value to set + * @return the JobInner object itself. + */ + public JobInner withTotalItemsToProcess(Long totalItemsToProcess) { + this.totalItemsToProcess = totalItemsToProcess; + return this; + } + + /** + * Get details of a job run. This field will only be sent for expand details filter. + * + * @return the details value + */ + public JobDetails details() { + return this.details; + } + + /** + * Set details of a job run. This field will only be sent for expand details filter. + * + * @param details the details value to set + * @return the JobInner object itself. + */ + public JobInner withDetails(JobDetails details) { + this.details = details; + return this; + } + + /** + * Get name of the data source on which the job was triggered. + * + * @return the dataSourceName value + */ + public String dataSourceName() { + return this.dataSourceName; + } + + /** + * Set name of the data source on which the job was triggered. + * + * @param dataSourceName the dataSourceName value to set + * @return the JobInner object itself. + */ + public JobInner withDataSourceName(String dataSourceName) { + this.dataSourceName = dataSourceName; + return this; + } + + /** + * Get name of the data sink on which the job was triggered. + * + * @return the dataSinkName value + */ + public String dataSinkName() { + return this.dataSinkName; + } + + /** + * Set name of the data sink on which the job was triggered. + * + * @param dataSinkName the dataSinkName value to set + * @return the JobInner object itself. + */ + public JobInner withDataSinkName(String dataSinkName) { + this.dataSinkName = dataSinkName; + return this; + } + + /** + * Get top level error for the job. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set top level error for the job. + * + * @param error the error value to set + * @return the JobInner object itself. + */ + public JobInner withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobsInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobsInner.java new file mode 100644 index 000000000000..1b98b9595674 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/JobsInner.java @@ -0,0 +1,1827 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import 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.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 Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.Jobs listByJobDefinition" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs") + Observable> listByJobDefinition(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}") + Observable> get(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("jobId") String jobId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.hybriddata.Jobs cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/cancel") + Observable> cancel(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("jobId") String jobId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.Jobs beginCancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/cancel") + Observable> beginCancel(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("jobId") String jobId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.Jobs resume" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/resume") + Observable> resume(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("jobId") String jobId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.Jobs beginResume" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/resume") + Observable> beginResume(@Path("dataServiceName") String dataServiceName, @Path("jobDefinitionName") String jobDefinitionName, @Path("jobId") String jobId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.Jobs listByDataService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobs") + Observable> listByDataService(@Path("dataServiceName") String dataServiceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.Jobs listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobs") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.hybriddata.Jobs listByJobDefinitionNext" }) + @GET + Observable> listByJobDefinitionNext(@Url String nextUrl, @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.hybriddata.Jobs listByDataServiceNext" }) + @GET + Observable> listByDataServiceNext(@Url String nextUrl, @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.hybriddata.Jobs listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByJobDefinition(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByJobDefinitionAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByJobDefinitionAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName) { + return listByJobDefinitionWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByJobDefinitionWithServiceResponseAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName) { + return listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByJobDefinitionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByJobDefinitionSinglePageAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByJobDefinition(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByJobDefinitionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByJobDefinition(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByJobDefinitionAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByJobDefinitionAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByJobDefinitionWithServiceResponseAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition for which jobs are needed. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByJobDefinitionWithServiceResponseAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByJobDefinitionSinglePageAsync(dataServiceName, jobDefinitionName, resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByJobDefinitionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + ServiceResponse> * @param dataServiceName The name of the data service of the job definition. + ServiceResponse> * @param jobDefinitionName The name of the job definition for which jobs are needed. + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByJobDefinitionSinglePageAsync(final String dataServiceName, final String jobDefinitionName, final String resourceGroupName, final String dataManagerName, final String filter) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByJobDefinition(dataServiceName, jobDefinitionName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByJobDefinitionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByJobDefinitionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 JobInner object if successful. + */ + public JobInner get(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 expand = null; + return service.get(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 JobInner object if successful. + */ + public JobInner get(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, String expand) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand).toBlocking().single().body(); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand), serviceCallback); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, String expand) { + return getWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName, expand).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method gets a data manager job given the jobId. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, String expand) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancel(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + cancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).toBlocking().last().body(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 cancelAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable cancelAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return cancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> cancelWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.cancel(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCancel(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + beginCancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 beginCancelAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCancelAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return beginCancelWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCancelWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.beginCancel(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resume(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + resumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).toBlocking().last().body(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 resumeAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resumeAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return resumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resumeWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.resume(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResume(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + beginResumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 beginResumeAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResumeAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + return beginResumeWithServiceResponseAsync(dataServiceName, jobDefinitionName, jobId, resourceGroupName, dataManagerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes the given job. + * + * @param dataServiceName The name of the data service of the job definition. + * @param jobDefinitionName The name of the job definition of the job. + * @param jobId The job id of the job queried. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResumeWithServiceResponseAsync(String dataServiceName, String jobDefinitionName, String jobId, String resourceGroupName, String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName is required and cannot be null."); + } + if (jobDefinitionName == null) { + throw new IllegalArgumentException("Parameter jobDefinitionName is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.beginResume(dataServiceName, jobDefinitionName, jobId, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResumeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResumeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataService(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + return listByDataServiceWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByDataServiceWithServiceResponseAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + return listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceSinglePageAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByDataService(dataServiceName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataService(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByDataServiceAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataServiceWithServiceResponseAsync(dataServiceName, resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param dataServiceName The name of the data service of interest. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByDataServiceWithServiceResponseAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataServiceSinglePageAsync(dataServiceName, resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + ServiceResponse> * @param dataServiceName The name of the data service of interest. + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceSinglePageAsync(final String dataServiceName, final String resourceGroupName, final String dataManagerName, final String filter) { + if (dataServiceName == null) { + throw new IllegalArgumentException("Parameter dataServiceName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataService(dataServiceName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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 filter = null; + return service.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName, final String filter) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + ServiceResponse> * @param filter OData Filter options + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName, final String filter) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByJobDefinitionNext(final String nextPageLink) { + ServiceResponse> response = listByJobDefinitionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a given job definition. + * + * @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> listByJobDefinitionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByJobDefinitionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @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<JobInner> object + */ + public Observable> listByJobDefinitionNextAsync(final String nextPageLink) { + return listByJobDefinitionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + * @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<JobInner> object + */ + public Observable>> listByJobDefinitionNextWithServiceResponseAsync(final String nextPageLink) { + return listByJobDefinitionNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByJobDefinitionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a given job definition. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByJobDefinitionNextSinglePageAsync(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.listByJobDefinitionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByJobDefinitionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByJobDefinitionNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataServiceNext(final String nextPageLink) { + ServiceResponse> response = listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @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> listByDataServiceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataServiceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @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<JobInner> object + */ + public Observable> listByDataServiceNextAsync(final String nextPageLink) { + return listByDataServiceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + * @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<JobInner> object + */ + public Observable>> listByDataServiceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataServiceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataServiceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs of a data service type in a given resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataServiceNextSinglePageAsync(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.listByDataServiceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataServiceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @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<JobInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + * @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<JobInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the jobs at the data manager resource level. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/OperationsInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/OperationsInner.java new file mode 100644 index 000000000000..e990a7af10e7 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl 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, HybridDataManagementClientImpl 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.hybriddata.Operations list" }) + @GET("providers/Microsoft.HybridData/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.hybriddata.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableProviderOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the 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.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableProviderOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableProviderOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableProviderOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailableProviderOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the 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.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the 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<AvailableProviderOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the 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<AvailableProviderOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableProviderOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PageImpl.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PageImpl.java new file mode 100644 index 000000000000..f4b293451180 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/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.hybriddata.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PageImpl1.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PageImpl1.java new file mode 100644 index 000000000000..6d358d9b37ff --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/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.hybriddata.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeyInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeyInner.java new file mode 100644 index 000000000000..66112bb83719 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeyInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybriddata.implementation; + +import com.microsoft.azure.management.hybriddata.Key; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.hybriddata.DmsBaseObject; + +/** + * Public key. + */ +@JsonFlatten +public class PublicKeyInner extends DmsBaseObject { + /** + * Level one public key for encryption. + */ + @JsonProperty(value = "properties.dataServiceLevel1Key", required = true) + private Key dataServiceLevel1Key; + + /** + * Level two public key for encryption. + */ + @JsonProperty(value = "properties.dataServiceLevel2Key", required = true) + private Key dataServiceLevel2Key; + + /** + * Get level one public key for encryption. + * + * @return the dataServiceLevel1Key value + */ + public Key dataServiceLevel1Key() { + return this.dataServiceLevel1Key; + } + + /** + * Set level one public key for encryption. + * + * @param dataServiceLevel1Key the dataServiceLevel1Key value to set + * @return the PublicKeyInner object itself. + */ + public PublicKeyInner withDataServiceLevel1Key(Key dataServiceLevel1Key) { + this.dataServiceLevel1Key = dataServiceLevel1Key; + return this; + } + + /** + * Get level two public key for encryption. + * + * @return the dataServiceLevel2Key value + */ + public Key dataServiceLevel2Key() { + return this.dataServiceLevel2Key; + } + + /** + * Set level two public key for encryption. + * + * @param dataServiceLevel2Key the dataServiceLevel2Key value to set + * @return the PublicKeyInner object itself. + */ + public PublicKeyInner withDataServiceLevel2Key(Key dataServiceLevel2Key) { + this.dataServiceLevel2Key = dataServiceLevel2Key; + return this; + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeysInner.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeysInner.java new file mode 100644 index 000000000000..c330640c25a9 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/PublicKeysInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.hybriddata.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 PublicKeys. + */ +public class PublicKeysInner { + /** The Retrofit service to perform REST calls. */ + private PublicKeysService service; + /** The service client containing this operation class. */ + private HybridDataManagementClientImpl client; + + /** + * Initializes an instance of PublicKeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicKeysInner(Retrofit retrofit, HybridDataManagementClientImpl client) { + this.service = retrofit.create(PublicKeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicKeys to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicKeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybriddata.PublicKeys listByDataManager" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys") + Observable> listByDataManager(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.PublicKeys get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName}") + Observable> get(@Path("publicKeyName") String publicKeyName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dataManagerName") String dataManagerName, @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.hybriddata.PublicKeys listByDataManagerNext" }) + @GET + Observable> listByDataManagerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicKeyInner> object if successful. + */ + public PagedList listByDataManager(final String resourceGroupName, final String dataManagerName) { + ServiceResponse> response = listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicKeyInner> object + */ + public Observable> listByDataManagerAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerWithServiceResponseAsync(resourceGroupName, dataManagerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicKeyInner> object + */ + public Observable>> listByDataManagerWithServiceResponseAsync(final String resourceGroupName, final String dataManagerName) { + return listByDataManagerSinglePageAsync(resourceGroupName, dataManagerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerSinglePageAsync(final String resourceGroupName, final String dataManagerName) { + 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 (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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.listByDataManager(this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 PublicKeyInner object if successful. + */ + public PublicKeyInner get(String publicKeyName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(publicKeyName, resourceGroupName, dataManagerName).toBlocking().single().body(); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 publicKeyName, String resourceGroupName, String dataManagerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(publicKeyName, resourceGroupName, dataManagerName), serviceCallback); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicKeyInner object + */ + public Observable getAsync(String publicKeyName, String resourceGroupName, String dataManagerName) { + return getWithServiceResponseAsync(publicKeyName, resourceGroupName, dataManagerName).map(new Func1, PublicKeyInner>() { + @Override + public PublicKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method gets the public keys. + * + * @param publicKeyName Name of the public key. + * @param resourceGroupName The Resource Group Name + * @param dataManagerName The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicKeyInner object + */ + public Observable> getWithServiceResponseAsync(String publicKeyName, String resourceGroupName, String dataManagerName) { + if (publicKeyName == null) { + throw new IllegalArgumentException("Parameter publicKeyName 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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataManagerName == null) { + throw new IllegalArgumentException("Parameter dataManagerName 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(publicKeyName, this.client.subscriptionId(), resourceGroupName, dataManagerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicKeyInner> object if successful. + */ + public PagedList listByDataManagerNext(final String nextPageLink) { + ServiceResponse> response = listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @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> listByDataManagerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataManagerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @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<PublicKeyInner> object + */ + public Observable> listByDataManagerNextAsync(final String nextPageLink) { + return listByDataManagerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + * @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<PublicKeyInner> object + */ + public Observable>> listByDataManagerNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataManagerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataManagerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets the list view of public keys, however it will only have one element. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataManagerNextSinglePageAsync(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.listByDataManagerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataManagerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataManagerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/package-info.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/package-info.java new file mode 100644 index 000000000000..c9a0f470cb6e --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights 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 HybridDataManagementClient. + */ +package com.microsoft.azure.management.hybriddata.implementation; diff --git a/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/package-info.java b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/package-info.java new file mode 100644 index 000000000000..6446eab2a2a6 --- /dev/null +++ b/azure-mgmt-hybriddatamanager/src/main/java/com/microsoft/azure/management/hybriddata/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights 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 HybridDataManagementClient. + */ +package com.microsoft.azure.management.hybriddata;