Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions logic/resource-manager/v2018_07_01_preview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
<version>0.0.3-beta</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>azure-mgmt-logic</artifactId>
<version>1.0.0-beta-1</version>
<version>1.0.0-beta</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for Logic Management</name>
<description>This package contains Microsoft Logic Management SDK.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package com.microsoft.azure.management.logic.v2018_07_01_preview;

import rx.Observable;
import rx.Completable;
import rx.Observable;
import com.microsoft.azure.management.logic.v2018_07_01_preview.implementation.WorkflowRunsInner;
import com.microsoft.azure.arm.model.HasInner;

Expand Down Expand Up @@ -49,4 +49,15 @@ public interface WorkflowRuns extends HasInner<WorkflowRunsInner> {
*/
Observable<WorkflowWorkflowRun> listAsync(final String resourceGroupName, final String workflowName);

/**
* Deletes a workflow run.
*
* @param resourceGroupName The resource group name.
* @param workflowName The workflow name.
* @param runName The workflow run name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Completable deleteAsync(String resourceGroupName, String workflowName, String runName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.logic.v2018_07_01_preview.WorkflowRuns;
import rx.Completable;
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import rx.Completable;
import com.microsoft.azure.management.logic.v2018_07_01_preview.WorkflowWorkflowRun;

class WorkflowRunsImpl extends WrapperImpl<WorkflowRunsInner> implements WorkflowRuns {
Expand Down Expand Up @@ -69,4 +69,10 @@ public WorkflowWorkflowRun call(WorkflowRunInner inner) {
});
}

@Override
public Completable deleteAsync(String resourceGroupName, String workflowName, String runName) {
WorkflowRunsInner client = this.inner();
return client.deleteAsync(resourceGroupName, workflowName, runName).toCompletable();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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.Query;
Expand Down Expand Up @@ -66,6 +67,10 @@ interface WorkflowRunsService {
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}")
Observable<Response<ResponseBody>> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workflowName") String workflowName, @Path("runName") String runName, @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.logic.v2018_07_01_preview.WorkflowRuns delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workflowName") String workflowName, @Path("runName") String runName, @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.logic.v2018_07_01_preview.WorkflowRuns cancel" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel")
Observable<Response<ResponseBody>> cancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workflowName") String workflowName, @Path("runName") String runName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -420,6 +425,99 @@ private ServiceResponse<WorkflowRunInner> getDelegate(Response<ResponseBody> res
.build(response);
}

/**
* Deletes a workflow run.
*
* @param resourceGroupName The resource group name.
* @param workflowName The workflow name.
* @param runName The workflow run name.
* @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 workflowName, String runName) {
deleteWithServiceResponseAsync(resourceGroupName, workflowName, runName).toBlocking().single().body();
}

/**
* Deletes a workflow run.
*
* @param resourceGroupName The resource group name.
* @param workflowName The workflow name.
* @param runName The workflow run 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<Void> deleteAsync(String resourceGroupName, String workflowName, String runName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workflowName, runName), serviceCallback);
}

/**
* Deletes a workflow run.
*
* @param resourceGroupName The resource group name.
* @param workflowName The workflow name.
* @param runName The workflow run name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> deleteAsync(String resourceGroupName, String workflowName, String runName) {
return deleteWithServiceResponseAsync(resourceGroupName, workflowName, runName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}

/**
* Deletes a workflow run.
*
* @param resourceGroupName The resource group name.
* @param workflowName The workflow name.
* @param runName The workflow run name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String workflowName, String runName) {
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 (workflowName == null) {
throw new IllegalArgumentException("Parameter workflowName is required and cannot be null.");
}
if (runName == null) {
throw new IllegalArgumentException("Parameter runName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.delete(this.client.subscriptionId(), resourceGroupName, workflowName, runName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = deleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<Void> deleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}

/**
* Cancels a workflow run.
*
Expand Down