View Javadoc
1   package com.acumenvelocity.ath.model;
2   
3   import java.util.Objects;
4   import java.util.UUID;
5   
6   import com.fasterxml.jackson.annotation.JsonCreator;
7   import com.fasterxml.jackson.annotation.JsonProperty;
8   import com.fasterxml.jackson.annotation.JsonValue;
9   
10  import io.swagger.annotations.ApiModelProperty;
11  
12  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", comments = "Generator version: 7.15.0")
13  public class ConflictResponse {
14    @JsonProperty("error")
15    private String error;
16  
17    /**
18     * Current status of the document
19     */
20    public enum StatusEnum {
21      IMPORTING("IMPORTING"),
22  
23      EXPORTING("EXPORTING"),
24  
25      IMPORT_COMPLETED("IMPORT_COMPLETED");
26  
27      private String value;
28  
29      StatusEnum(String value) {
30        this.value = value;
31      }
32  
33      @Override
34      @JsonValue
35      public String toString() {
36        return String.valueOf(value);
37      }
38  
39      @JsonCreator
40      public static StatusEnum fromValue(String text) {
41        for (StatusEnum b : StatusEnum.values()) {
42          if (String.valueOf(b.value).equals(text)) {
43            return b;
44          }
45        }
46        throw new IllegalArgumentException("Unexpected value '" + text + "'");
47      }
48    }
49  
50    @JsonProperty("status")
51    private StatusEnum status;
52  
53    @JsonProperty("doc_id")
54    private UUID docId;
55  
56    @JsonProperty("message")
57    private String message;
58  
59    @JsonProperty("status_url")
60    private String statusUrl;
61  
62    /**
63     * Error message
64     **/
65    public ConflictResponse error(String error) {
66      this.error = error;
67      return this;
68    }
69  
70    @ApiModelProperty(example = "Processing already in progress", required = true, value = "Error message")
71    @JsonProperty("error")
72    public String getError() {
73      return error;
74    }
75  
76    public void setError(String error) {
77      this.error = error;
78    }
79  
80    /**
81     * Current status of the document
82     **/
83    public ConflictResponse status(StatusEnum status) {
84      this.status = status;
85      return this;
86    }
87  
88    @ApiModelProperty(example = "IMPORTING", required = true, value = "Current status of the document")
89    @JsonProperty("status")
90    public StatusEnum getStatus() {
91      return status;
92    }
93  
94    public void setStatus(StatusEnum status) {
95      this.status = status;
96    }
97  
98    /**
99     * Unique identifier of the document
100    **/
101   public ConflictResponse docId(UUID docId) {
102     this.docId = docId;
103     return this;
104   }
105 
106   @ApiModelProperty(example = "550e8400-e29b-41d4-a716-446655440000", required = true, value = "Unique identifier of the document")
107   @JsonProperty("doc_id")
108   public UUID getDocId() {
109     return docId;
110   }
111 
112   public void setDocId(UUID docId) {
113     this.docId = docId;
114   }
115 
116   /**
117    * Detailed message about the conflict
118    **/
119   public ConflictResponse message(String message) {
120     this.message = message;
121     return this;
122   }
123 
124   @ApiModelProperty(example = "Import must be completed before export can be triggered", value = "Detailed message about the conflict")
125   @JsonProperty("message")
126   public String getMessage() {
127     return message;
128   }
129 
130   public void setMessage(String message) {
131     this.message = message;
132   }
133 
134   /**
135    * URL to check processing status
136    **/
137   public ConflictResponse statusUrl(String statusUrl) {
138     this.statusUrl = statusUrl;
139     return this;
140   }
141 
142   @ApiModelProperty(example = "/document/550e8400-e29b-41d4-a716-446655440000/status", value = "URL to check processing status")
143   @JsonProperty("status_url")
144   public String getStatusUrl() {
145     return statusUrl;
146   }
147 
148   public void setStatusUrl(String statusUrl) {
149     this.statusUrl = statusUrl;
150   }
151 
152   @Override
153   public boolean equals(Object o) {
154     if (this == o) {
155       return true;
156     }
157     if (o == null || getClass() != o.getClass()) {
158       return false;
159     }
160     ConflictResponse conflictResponse = (ConflictResponse) o;
161     return Objects.equals(error, conflictResponse.error) &&
162         Objects.equals(status, conflictResponse.status) &&
163         Objects.equals(docId, conflictResponse.docId) &&
164         Objects.equals(message, conflictResponse.message) &&
165         Objects.equals(statusUrl, conflictResponse.statusUrl);
166   }
167 
168   @Override
169   public int hashCode() {
170     return Objects.hash(error, status, docId, message, statusUrl);
171   }
172 
173   @Override
174   public String toString() {
175     StringBuilder sb = new StringBuilder();
176     sb.append("class ConflictResponse {\n");
177 
178     sb.append("    error: ").append(toIndentedString(error)).append("\n");
179     sb.append("    status: ").append(toIndentedString(status)).append("\n");
180     sb.append("    docId: ").append(toIndentedString(docId)).append("\n");
181     sb.append("    message: ").append(toIndentedString(message)).append("\n");
182     sb.append("    statusUrl: ").append(toIndentedString(statusUrl)).append("\n");
183     sb.append("}");
184     return sb.toString();
185   }
186 
187   /**
188    * Convert the given object to string with each line indented by 4 spaces
189    * (except the first line).
190    */
191   private String toIndentedString(Object o) {
192     if (o == null) {
193       return "null";
194     }
195     return o.toString().replace("\n", "\n    ");
196   }
197 }