diff --git a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimePermissionRequest.java b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimePermissionRequest.java new file mode 100644 index 00000000000..5ffa38e53f2 --- /dev/null +++ b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimePermissionRequest.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.datafactory; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Grant or revoke access to integration runtime request. + */ +public class IntegrationRuntimePermissionRequest { + /** + * The data factory identity. + */ + @JsonProperty(value = "factoryIdentity", required = true) + private String factoryIdentity; + + /** + * Get the factoryIdentity value. + * + * @return the factoryIdentity value + */ + public String factoryIdentity() { + return this.factoryIdentity; + } + + /** + * Set the factoryIdentity value. + * + * @param factoryIdentity the factoryIdentity value to set + * @return the IntegrationRuntimePermissionRequest object itself. + */ + public IntegrationRuntimePermissionRequest withFactoryIdentity(String factoryIdentity) { + this.factoryIdentity = factoryIdentity; + return this; + } + +} diff --git a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimeState.java b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimeState.java index 441fcc6cbd0..8d0cf30c2df 100644 --- a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimeState.java +++ b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/IntegrationRuntimeState.java @@ -43,6 +43,9 @@ public final class IntegrationRuntimeState extends ExpandableStringEnum links; + /** + * The version that the integration runtime is going to update to. + */ + @JsonProperty(value = "typeProperties.pushedVersion", access = JsonProperty.Access.WRITE_ONLY) + private String pushedVersion; + + /** + * The latest version on download center. + */ + @JsonProperty(value = "typeProperties.latestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String latestVersion; + /** * Get the createTime value. * @@ -249,4 +261,22 @@ public SelfHostedIntegrationRuntimeStatus withLinks(List> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @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.datafactory.Factories listSharedFactory" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/sharedFactory") + Observable> listSharedFactory(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @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.datafactory.Factories listSharedIntegrationRuntime" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/sharedIntegrationRuntime") + Observable> listSharedIntegrationRuntime(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Query("dataFactoryResourceId") String dataFactoryResourceId, @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.datafactory.Factories cancelPipelineRun" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/cancelpipelinerun/{runId}") Observable> cancelPipelineRun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -687,6 +695,262 @@ private ServiceResponse deleteDelegate(Response response) th .build(response); } + /** + * List data factories which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FactoryListResponseInner object if successful. + */ + public FactoryListResponseInner listSharedFactory(String resourceGroupName, String factoryName) { + return listSharedFactoryWithServiceResponseAsync(resourceGroupName, factoryName).toBlocking().single().body(); + } + + /** + * List data factories which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSharedFactoryAsync(String resourceGroupName, String factoryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedFactoryWithServiceResponseAsync(resourceGroupName, factoryName), serviceCallback); + } + + /** + * List data factories which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FactoryListResponseInner object + */ + public Observable listSharedFactoryAsync(String resourceGroupName, String factoryName) { + return listSharedFactoryWithServiceResponseAsync(resourceGroupName, factoryName).map(new Func1, FactoryListResponseInner>() { + @Override + public FactoryListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List data factories which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FactoryListResponseInner object + */ + public Observable> listSharedFactoryWithServiceResponseAsync(String resourceGroupName, String factoryName) { + 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 (factoryName == null) { + throw new IllegalArgumentException("Parameter factoryName 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.listSharedFactory(this.client.subscriptionId(), resourceGroupName, factoryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedFactoryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedFactoryDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IntegrationRuntimeListResponseInner object if successful. + */ + public IntegrationRuntimeListResponseInner listSharedIntegrationRuntime(String resourceGroupName, String factoryName) { + return listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName).toBlocking().single().body(); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSharedIntegrationRuntimeAsync(String resourceGroupName, String factoryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName), serviceCallback); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeListResponseInner object + */ + public Observable listSharedIntegrationRuntimeAsync(String resourceGroupName, String factoryName) { + return listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName).map(new Func1, IntegrationRuntimeListResponseInner>() { + @Override + public IntegrationRuntimeListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeListResponseInner object + */ + public Observable> listSharedIntegrationRuntimeWithServiceResponseAsync(String resourceGroupName, String factoryName) { + 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 (factoryName == null) { + throw new IllegalArgumentException("Parameter factoryName 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 dataFactoryResourceId = null; + return service.listSharedIntegrationRuntime(this.client.subscriptionId(), resourceGroupName, factoryName, dataFactoryResourceId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedIntegrationRuntimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param dataFactoryResourceId The factory resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IntegrationRuntimeListResponseInner object if successful. + */ + public IntegrationRuntimeListResponseInner listSharedIntegrationRuntime(String resourceGroupName, String factoryName, String dataFactoryResourceId) { + return listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName, dataFactoryResourceId).toBlocking().single().body(); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param dataFactoryResourceId The factory resource identifier. + * @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 listSharedIntegrationRuntimeAsync(String resourceGroupName, String factoryName, String dataFactoryResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName, dataFactoryResourceId), serviceCallback); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param dataFactoryResourceId The factory resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeListResponseInner object + */ + public Observable listSharedIntegrationRuntimeAsync(String resourceGroupName, String factoryName, String dataFactoryResourceId) { + return listSharedIntegrationRuntimeWithServiceResponseAsync(resourceGroupName, factoryName, dataFactoryResourceId).map(new Func1, IntegrationRuntimeListResponseInner>() { + @Override + public IntegrationRuntimeListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List integration runtimes which the given data factory has access. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param dataFactoryResourceId The factory resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeListResponseInner object + */ + public Observable> listSharedIntegrationRuntimeWithServiceResponseAsync(String resourceGroupName, String factoryName, String dataFactoryResourceId) { + 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 (factoryName == null) { + throw new IllegalArgumentException("Parameter factoryName 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.listSharedIntegrationRuntime(this.client.subscriptionId(), resourceGroupName, factoryName, dataFactoryResourceId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSharedIntegrationRuntimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSharedIntegrationRuntimeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** * Cancel a pipeline run by its run ID. * diff --git a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/FactoryListResponseInner.java b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/FactoryListResponseInner.java new file mode 100644 index 00000000000..05c39af4997 --- /dev/null +++ b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/FactoryListResponseInner.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.datafactory.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of factory resources. + */ +public class FactoryListResponseInner { + /** + * List of factories. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the FactoryListResponseInner object itself. + */ + public FactoryListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink value. + * + * @param nextLink the nextLink value to set + * @return the FactoryListResponseInner object itself. + */ + public FactoryListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimeListResponseInner.java b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimeListResponseInner.java new file mode 100644 index 00000000000..c417b46d647 --- /dev/null +++ b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimeListResponseInner.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.datafactory.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of integration runtime resources. + */ +public class IntegrationRuntimeListResponseInner { + /** + * List of integration runtimes. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the IntegrationRuntimeListResponseInner object itself. + */ + public IntegrationRuntimeListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink value. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink value. + * + * @param nextLink the nextLink value to set + * @return the IntegrationRuntimeListResponseInner object itself. + */ + public IntegrationRuntimeListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimesInner.java b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimesInner.java index 41ca85591f5..5fecb16b842 100644 --- a/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimesInner.java +++ b/azure-mgmt-datafactory/src/main/java/com/microsoft/azure/management/datafactory/implementation/IntegrationRuntimesInner.java @@ -14,6 +14,7 @@ import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.datafactory.ErrorResponseException; import com.microsoft.azure.management.datafactory.IntegrationRuntimeAuthKeyName; +import com.microsoft.azure.management.datafactory.IntegrationRuntimePermissionRequest; import com.microsoft.azure.management.datafactory.IntegrationRuntimeRegenerateKeyParameters; import com.microsoft.azure.management.datafactory.IntegrationRuntimeRemoveNodeRequest; import com.microsoft.azure.management.datafactory.UpdateIntegrationRuntimeRequest; @@ -135,6 +136,14 @@ interface IntegrationRuntimesService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/upgrade") Observable> upgrade(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Path("integrationRuntimeName") String integrationRuntimeName, @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.datafactory.IntegrationRuntimes grantAccess" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/grantAccess") + Observable> grantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body IntegrationRuntimePermissionRequest integrationRuntimePermissionRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datafactory.IntegrationRuntimes revokeAccess" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/revokeAccess") + Observable> revokeAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body IntegrationRuntimePermissionRequest integrationRuntimePermissionRequest, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datafactory.IntegrationRuntimes listByFactoryNext" }) @GET Observable> listByFactoryNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -571,9 +580,9 @@ private ServiceResponse getDelegate(Response updateAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, updateIntegrationRuntimeRequest), serviceCallback); } @@ -600,12 +609,12 @@ public ServiceFuture updateAsync(String r * @param integrationRuntimeName The integration runtime name. * @param updateIntegrationRuntimeRequest The parameters for updating an integration runtime. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IntegrationRuntimeStatusResponseInner object + * @return the observable to the IntegrationRuntimeResourceInner object */ - public Observable updateAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { - return updateWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, updateIntegrationRuntimeRequest).map(new Func1, IntegrationRuntimeStatusResponseInner>() { + public Observable updateAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { + return updateWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, updateIntegrationRuntimeRequest).map(new Func1, IntegrationRuntimeResourceInner>() { @Override - public IntegrationRuntimeStatusResponseInner call(ServiceResponse response) { + public IntegrationRuntimeResourceInner call(ServiceResponse response) { return response.body(); } }); @@ -619,9 +628,9 @@ public IntegrationRuntimeStatusResponseInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -642,11 +651,11 @@ public Observable> update } Validator.validate(updateIntegrationRuntimeRequest); return service.update(this.client.subscriptionId(), resourceGroupName, factoryName, integrationRuntimeName, this.client.apiVersion(), updateIntegrationRuntimeRequest, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -655,9 +664,9 @@ public Observable> call(R }); } - private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -1938,6 +1947,208 @@ private ServiceResponse upgradeDelegate(Response response) t .build(response); } + /** + * Grant integration runtime access to other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void grantAccess(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + grantAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity).toBlocking().single().body(); + } + + /** + * Grant integration runtime access to other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @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 grantAccessAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(grantAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity), serviceCallback); + } + + /** + * Grant integration runtime access to other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable grantAccessAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + return grantAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Grant integration runtime access to other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> grantAccessWithServiceResponseAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + 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 (factoryName == null) { + throw new IllegalArgumentException("Parameter factoryName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName 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 (factoryIdentity == null) { + throw new IllegalArgumentException("Parameter factoryIdentity is required and cannot be null."); + } + IntegrationRuntimePermissionRequest integrationRuntimePermissionRequest = new IntegrationRuntimePermissionRequest(); + integrationRuntimePermissionRequest.withFactoryIdentity(factoryIdentity); + return service.grantAccess(this.client.subscriptionId(), resourceGroupName, factoryName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), integrationRuntimePermissionRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = grantAccessDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse grantAccessDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void revokeAccess(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + revokeAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity).toBlocking().single().body(); + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @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 revokeAccessAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revokeAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity), serviceCallback); + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable revokeAccessAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + return revokeAccessWithServiceResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, factoryIdentity).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param integrationRuntimeName The integration runtime name. + * @param factoryIdentity The data factory identity. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> revokeAccessWithServiceResponseAsync(String resourceGroupName, String factoryName, String integrationRuntimeName, String factoryIdentity) { + 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 (factoryName == null) { + throw new IllegalArgumentException("Parameter factoryName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName 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 (factoryIdentity == null) { + throw new IllegalArgumentException("Parameter factoryIdentity is required and cannot be null."); + } + IntegrationRuntimePermissionRequest integrationRuntimePermissionRequest = new IntegrationRuntimePermissionRequest(); + integrationRuntimePermissionRequest.withFactoryIdentity(factoryIdentity); + return service.revokeAccess(this.client.subscriptionId(), resourceGroupName, factoryName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), integrationRuntimePermissionRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = revokeAccessDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse revokeAccessDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** * Lists integration runtimes. *