001 002package com.commercetools.ml.models.common; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.validation.constraints.NotNull; 009 010import com.fasterxml.jackson.annotation.*; 011import com.fasterxml.jackson.databind.annotation.*; 012 013import io.vrap.rmf.base.client.utils.Generated; 014 015/** 016 * <p>Represents a URL path to poll to get the results of an Asynchronous Request.</p> 017 * 018 * <hr> 019 * Example to create an instance using the builder pattern 020 * <div class=code-example> 021 * <pre><code class='java'> 022 * TaskToken taskToken = TaskToken.builder() 023 * .taskId("{taskId}") 024 * .uriPath("{uriPath}") 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = TaskTokenImpl.class) 031public interface TaskToken { 032 033 /** 034 * <p>The ID for the task. Used to find the status of the task.</p> 035 */ 036 @NotNull 037 @JsonProperty("taskId") 038 public String getTaskId(); 039 040 /** 041 * <p>The URI path to poll for the status of the task.</p> 042 */ 043 @NotNull 044 @JsonProperty("uriPath") 045 public String getUriPath(); 046 047 public void setTaskId(final String taskId); 048 049 public void setUriPath(final String uriPath); 050 051 public static TaskToken of() { 052 return new TaskTokenImpl(); 053 } 054 055 public static TaskToken of(final TaskToken template) { 056 TaskTokenImpl instance = new TaskTokenImpl(); 057 instance.setTaskId(template.getTaskId()); 058 instance.setUriPath(template.getUriPath()); 059 return instance; 060 } 061 062 public static TaskTokenBuilder builder() { 063 return TaskTokenBuilder.of(); 064 } 065 066 public static TaskTokenBuilder builder(final TaskToken template) { 067 return TaskTokenBuilder.of(template); 068 } 069 070 default <T> T withTaskToken(Function<TaskToken, T> helper) { 071 return helper.apply(this); 072 } 073 074 public static com.fasterxml.jackson.core.type.TypeReference<TaskToken> typeReference() { 075 return new com.fasterxml.jackson.core.type.TypeReference<TaskToken>() { 076 @Override 077 public String toString() { 078 return "TypeReference<TaskToken>"; 079 } 080 }; 081 } 082}