All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.knock.api.model.WorkflowCancelRequest Maven / Gradle / Ivy

package app.knock.api.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Builder;
import lombok.Value;
import lombok.extern.jackson.Jacksonized;

import java.util.List;

@Value
@Jacksonized
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class WorkflowCancelRequest {
    String key;
    List recipients;
    String cancellation_key;

    public static WorkflowCancelRequest from(WorkflowTriggerRequest workflowTrigger) {
        return WorkflowCancelRequest.builder()
                .key(workflowTrigger.getKey())
                .recipients(workflowTrigger.getRecipients())
                .cancellation_key(workflowTrigger.getCancellationKey())
                .build();
    }

}