View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.Date;
4   import java.util.Objects;
5   import java.util.UUID;
6   
7   import com.fasterxml.jackson.annotation.JsonCreator;
8   import com.fasterxml.jackson.annotation.JsonProperty;
9   import com.fasterxml.jackson.annotation.JsonValue;
10  
11  import io.swagger.annotations.ApiModelProperty;
12  
13  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
14  public class FailedStatusResponse {
15    /**
16     * Document processing failed
17     */
18    public enum StatusEnum {
19      FAILED("FAILED");
20  
21      private String value;
22  
23      StatusEnum(String value) {
24        this.value = value;
25      }
26  
27      @Override
28      @JsonValue
29      public String toString() {
30        return String.valueOf(value);
31      }
32  
33      @JsonCreator
34      public static StatusEnum fromValue(String text) {
35        for (StatusEnum b : StatusEnum.values()) {
36          if (String.valueOf(b.value).equals(text)) {
37            return b;
38          }
39        }
40        throw new IllegalArgumentException("Unexpected value '" + text + "'");
41      }
42    }
43  
44    @JsonProperty("status")
45    private StatusEnum status;
46  
47    @JsonProperty("doc_id")
48    private UUID docId;
49  
50    @JsonProperty("error_message")
51    private String errorMessage;
52  
53    /**
54     * Machine-readable error type
55     */
56    public enum ErrorTypeEnum {
57      TIMEOUT("TIMEOUT"),
58  
59      INVALID_FORMAT("INVALID_FORMAT"),
60  
61      PIPELINE_ERROR("PIPELINE_ERROR"),
62  
63      INSUFFICIENT_RESOURCES("INSUFFICIENT_RESOURCES"),
64  
65      UNKNOWN_ERROR("UNKNOWN_ERROR");
66  
67      private String value;
68  
69      ErrorTypeEnum(String value) {
70        this.value = value;
71      }
72  
73      @Override
74      @JsonValue
75      public String toString() {
76        return String.valueOf(value);
77      }
78  
79      @JsonCreator
80      public static ErrorTypeEnum fromValue(String text) {
81        for (ErrorTypeEnum b : ErrorTypeEnum.values()) {
82          if (String.valueOf(b.value).equals(text)) {
83            return b;
84          }
85        }
86        throw new IllegalArgumentException("Unexpected value '" + text + "'");
87      }
88    }
89  
90    @JsonProperty("error_type")
91    private ErrorTypeEnum errorType;
92  
93    @JsonProperty("failed_at")
94    private Date failedAt;
95  
96    /**
97     * Document processing failed
98     **/
99    public FailedStatusResponse status(StatusEnum status) {
100     this.status = status;
101     return this;
102   }
103 
104   @ApiModelProperty(example = "FAILED", required = true, value = "Document processing failed")
105   @JsonProperty("status")
106   public StatusEnum getStatus() {
107     return status;
108   }
109 
110   public void setStatus(StatusEnum status) {
111     this.status = status;
112   }
113 
114   /**
115    * Unique identifier of the document
116    **/
117   public FailedStatusResponse docId(UUID docId) {
118     this.docId = docId;
119     return this;
120   }
121 
122   @ApiModelProperty(example = "550e8400-e29b-41d4-a716-446655440000", required = true, value = "Unique identifier of the document")
123   @JsonProperty("doc_id")
124   public UUID getDocId() {
125     return docId;
126   }
127 
128   public void setDocId(UUID docId) {
129     this.docId = docId;
130   }
131 
132   /**
133    * Error message describing why processing failed
134    **/
135   public FailedStatusResponse errorMessage(String errorMessage) {
136     this.errorMessage = errorMessage;
137     return this;
138   }
139 
140   @ApiModelProperty(example = "Invalid file format", required = true, value = "Error message describing why processing failed")
141   @JsonProperty("error_message")
142   public String getErrorMessage() {
143     return errorMessage;
144   }
145 
146   public void setErrorMessage(String errorMessage) {
147     this.errorMessage = errorMessage;
148   }
149 
150   /**
151    * Machine-readable error type
152    **/
153   public FailedStatusResponse errorType(ErrorTypeEnum errorType) {
154     this.errorType = errorType;
155     return this;
156   }
157 
158   @ApiModelProperty(example = "TIMEOUT", required = true, value = "Machine-readable error type")
159   @JsonProperty("error_type")
160   public ErrorTypeEnum getErrorType() {
161     return errorType;
162   }
163 
164   public void setErrorType(ErrorTypeEnum errorType) {
165     this.errorType = errorType;
166   }
167 
168   /**
169    * Timestamp when processing failed
170    **/
171   public FailedStatusResponse failedAt(Date failedAt) {
172     this.failedAt = failedAt;
173     return this;
174   }
175 
176   @ApiModelProperty(example = "2025-10-10T14:30Z", required = true, value = "Timestamp when processing failed")
177   @JsonProperty("failed_at")
178   public Date getFailedAt() {
179     return failedAt;
180   }
181 
182   public void setFailedAt(Date failedAt) {
183     this.failedAt = failedAt;
184   }
185 
186   @Override
187   public boolean equals(Object o) {
188     if (this == o) {
189       return true;
190     }
191     if (o == null || getClass() != o.getClass()) {
192       return false;
193     }
194     FailedStatusResponse failedStatusResponse = (FailedStatusResponse) o;
195     return Objects.equals(status, failedStatusResponse.status) &&
196         Objects.equals(docId, failedStatusResponse.docId) &&
197         Objects.equals(errorMessage, failedStatusResponse.errorMessage) &&
198         Objects.equals(errorType, failedStatusResponse.errorType) &&
199         Objects.equals(failedAt, failedStatusResponse.failedAt);
200   }
201 
202   @Override
203   public int hashCode() {
204     return Objects.hash(status, docId, errorMessage, errorType, failedAt);
205   }
206 
207   @Override
208   public String toString() {
209     StringBuilder sb = new StringBuilder();
210     sb.append("class FailedStatusResponse {\n");
211 
212     sb.append("    status: ").append(toIndentedString(status)).append("\n");
213     sb.append("    docId: ").append(toIndentedString(docId)).append("\n");
214     sb.append("    errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
215     sb.append("    errorType: ").append(toIndentedString(errorType)).append("\n");
216     sb.append("    failedAt: ").append(toIndentedString(failedAt)).append("\n");
217     sb.append("}");
218     return sb.toString();
219   }
220 
221   /**
222    * Convert the given object to string with each line indented by 4 spaces
223    * (except the first line).
224    */
225   private String toIndentedString(Object o) {
226     if (o == null) {
227       return "null";
228     }
229     return o.toString().replace("\n", "\n    ");
230   }
231 }