From dbde1f9c50b16febcad78b6cceb4c3b26f948ac9 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2019 19:38:58 +0000 Subject: [PATCH] Generated from 814795cce5766e56d08e877d7f359c2d6380a8be (#4676) update example --- .../datafactory/v2018_06_01/CopySource.java | 1 + .../datafactory/v2018_06_01/TriggerRuns.java | 17 ++- .../DataFactoryManagementClientImpl.java | 26 ++--- .../implementation/DataFactoryManager.java | 24 ++-- .../implementation/DatasetInner.java | 2 + .../implementation/TriggerRunsImpl.java | 7 ++ .../implementation/TriggerRunsInner.java | 103 ++++++++++++++++++ 7 files changed, 152 insertions(+), 28 deletions(-) diff --git a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/CopySource.java b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/CopySource.java index e410118fcea6a..6cd0cad90e2bb 100644 --- a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/CopySource.java +++ b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/CopySource.java @@ -84,6 +84,7 @@ @JsonSubTypes.Type(name = "SalesforceServiceCloudSource", value = SalesforceServiceCloudSource.class), @JsonSubTypes.Type(name = "SalesforceSource", value = SalesforceSource.class), @JsonSubTypes.Type(name = "ODataSource", value = ODataSource.class), + @JsonSubTypes.Type(name = "SapBwSource", value = SapBwSource.class), @JsonSubTypes.Type(name = "SybaseSource", value = SybaseSource.class), @JsonSubTypes.Type(name = "PostgreSqlSource", value = PostgreSqlSource.class), @JsonSubTypes.Type(name = "MySqlSource", value = MySqlSource.class), diff --git a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/TriggerRuns.java b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/TriggerRuns.java index 495f1ccde4d13..bdce89dc5fefb 100644 --- a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/TriggerRuns.java +++ b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/TriggerRuns.java @@ -8,14 +8,25 @@ package com.microsoft.azure.management.datafactory.v2018_06_01; +import rx.Completable; import rx.Observable; -import com.microsoft.azure.management.datafactory.v2018_06_01.implementation.TriggerRunsInner; -import com.microsoft.azure.arm.model.HasInner; /** * Type representing TriggerRuns. */ -public interface TriggerRuns extends HasInner { +public interface TriggerRuns { + /** + * Rerun single trigger instance by runId. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param triggerName The trigger name. + * @param runId The pipeline run identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable rerunAsync(String resourceGroupName, String factoryName, String triggerName, String runId); + /** * Query trigger runs. * diff --git a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManagementClientImpl.java b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManagementClientImpl.java index 2d8f762b9a0df..97f5e26e12319 100644 --- a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManagementClientImpl.java +++ b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManagementClientImpl.java @@ -289,29 +289,29 @@ public TriggersInner triggers() { } /** - * The RerunTriggersInner object to access its operations. + * The TriggerRunsInner object to access its operations. */ - private RerunTriggersInner rerunTriggers; + private TriggerRunsInner triggerRuns; /** - * Gets the RerunTriggersInner object to access its operations. - * @return the RerunTriggersInner object. + * Gets the TriggerRunsInner object to access its operations. + * @return the TriggerRunsInner object. */ - public RerunTriggersInner rerunTriggers() { - return this.rerunTriggers; + public TriggerRunsInner triggerRuns() { + return this.triggerRuns; } /** - * The TriggerRunsInner object to access its operations. + * The RerunTriggersInner object to access its operations. */ - private TriggerRunsInner triggerRuns; + private RerunTriggersInner rerunTriggers; /** - * Gets the TriggerRunsInner object to access its operations. - * @return the TriggerRunsInner object. + * Gets the RerunTriggersInner object to access its operations. + * @return the RerunTriggersInner object. */ - public TriggerRunsInner triggerRuns() { - return this.triggerRuns; + public RerunTriggersInner rerunTriggers() { + return this.rerunTriggers; } /** @@ -361,8 +361,8 @@ protected void initialize() { this.pipelineRuns = new PipelineRunsInner(restClient().retrofit(), this); this.activityRuns = new ActivityRunsInner(restClient().retrofit(), this); this.triggers = new TriggersInner(restClient().retrofit(), this); - this.rerunTriggers = new RerunTriggersInner(restClient().retrofit(), this); this.triggerRuns = new TriggerRunsInner(restClient().retrofit(), this); + this.rerunTriggers = new RerunTriggersInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManager.java b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManager.java index ac05e913b22dc..66332e2048d5c 100644 --- a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManager.java +++ b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/DataFactoryManager.java @@ -28,8 +28,8 @@ import com.microsoft.azure.management.datafactory.v2018_06_01.PipelineRuns; import com.microsoft.azure.management.datafactory.v2018_06_01.ActivityRuns; import com.microsoft.azure.management.datafactory.v2018_06_01.Triggers; -import com.microsoft.azure.management.datafactory.v2018_06_01.RerunTriggers; import com.microsoft.azure.management.datafactory.v2018_06_01.TriggerRuns; +import com.microsoft.azure.management.datafactory.v2018_06_01.RerunTriggers; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -49,8 +49,8 @@ public final class DataFactoryManager extends ManagerCore queryByFactoryAsync(String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { TriggerRunsInner client = this.inner(); diff --git a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/TriggerRunsInner.java b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/TriggerRunsInner.java index 11bd850a82a51..1ee31c0d96c82 100644 --- a/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/TriggerRunsInner.java +++ b/datafactory/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/implementation/TriggerRunsInner.java @@ -54,12 +54,115 @@ public TriggerRunsInner(Retrofit retrofit, DataFactoryManagementClientImpl clien * used by Retrofit to perform actually REST calls. */ interface TriggerRunsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datafactory.v2018_06_01.TriggerRuns rerun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/triggerRuns/{runId}/rerun") + Observable> rerun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Path("triggerName") String triggerName, @Path("runId") String runId, @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.v2018_06_01.TriggerRuns queryByFactory" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/queryTriggerRuns") Observable> queryByFactory(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("factoryName") String factoryName, @Query("api-version") String apiVersion, @Body RunFilterParameters filterParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } + /** + * Rerun single trigger instance by runId. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param triggerName The trigger name. + * @param runId The pipeline run identifier. + * @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 rerun(String resourceGroupName, String factoryName, String triggerName, String runId) { + rerunWithServiceResponseAsync(resourceGroupName, factoryName, triggerName, runId).toBlocking().single().body(); + } + + /** + * Rerun single trigger instance by runId. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param triggerName The trigger name. + * @param runId The pipeline run 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 rerunAsync(String resourceGroupName, String factoryName, String triggerName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rerunWithServiceResponseAsync(resourceGroupName, factoryName, triggerName, runId), serviceCallback); + } + + /** + * Rerun single trigger instance by runId. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param triggerName The trigger name. + * @param runId The pipeline run identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable rerunAsync(String resourceGroupName, String factoryName, String triggerName, String runId) { + return rerunWithServiceResponseAsync(resourceGroupName, factoryName, triggerName, runId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Rerun single trigger instance by runId. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param triggerName The trigger name. + * @param runId The pipeline run identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> rerunWithServiceResponseAsync(String resourceGroupName, String factoryName, String triggerName, String runId) { + 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 (triggerName == null) { + throw new IllegalArgumentException("Parameter triggerName is required and cannot be null."); + } + if (runId == null) { + throw new IllegalArgumentException("Parameter runId 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.rerun(this.client.subscriptionId(), resourceGroupName, factoryName, triggerName, runId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = rerunDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse rerunDelegate(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); + } + /** * Query trigger runs. *