Skip to content

Commit 1600fc3

Browse files
feat(specs): add with transformation helpers (generated)
algolia/api-clients-automation#4931 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 4e2ab96 commit 1600fc3

File tree

5 files changed

+437
-3
lines changed

5 files changed

+437
-3
lines changed

algoliasearch/src/main/java/com/algolia/model/ingestion/WatchResponse.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public WatchResponse addData(Object dataItem) {
6666
}
6767

6868
/**
69-
* when used with discovering or validating sources, the sampled data of your source is returned.
69+
* This field is always null when used with the Push endpoint. When used for a source discover or
70+
* source validate run, it will include the sampled data of the source.
7071
*/
7172
@javax.annotation.Nullable
7273
public List<Object> getData() {
@@ -86,7 +87,7 @@ public WatchResponse addEvents(Event eventsItem) {
8687
return this;
8788
}
8889

89-
/** in case of error, observability events will be added to the response, if any. */
90+
/** in case of error, observability events will be added to the response. */
9091
@javax.annotation.Nullable
9192
public List<Event> getEvents() {
9293
return events;
@@ -97,7 +98,10 @@ public WatchResponse setMessage(String message) {
9798
return this;
9899
}
99100

100-
/** a message describing the outcome of a validate run. */
101+
/**
102+
* a message describing the outcome of the operation that has been ran (push, discover or
103+
* validate) run.
104+
*/
101105
@javax.annotation.Nullable
102106
public String getMessage() {
103107
return message;
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
2+
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
package com.algolia.model.search;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.HashMap;
9+
import java.util.Map;
10+
import java.util.Objects;
11+
12+
/** An event describe a step of the task execution flow.. */
13+
public class Event {
14+
15+
@JsonProperty("eventID")
16+
private String eventID;
17+
18+
@JsonProperty("runID")
19+
private String runID;
20+
21+
@JsonProperty("status")
22+
private EventStatus status;
23+
24+
@JsonProperty("type")
25+
private EventType type;
26+
27+
@JsonProperty("batchSize")
28+
private Integer batchSize;
29+
30+
@JsonProperty("data")
31+
private Map<String, Object> data;
32+
33+
@JsonProperty("publishedAt")
34+
private String publishedAt;
35+
36+
public Event setEventID(String eventID) {
37+
this.eventID = eventID;
38+
return this;
39+
}
40+
41+
/** Universally unique identifier (UUID) of an event. */
42+
@javax.annotation.Nonnull
43+
public String getEventID() {
44+
return eventID;
45+
}
46+
47+
public Event setRunID(String runID) {
48+
this.runID = runID;
49+
return this;
50+
}
51+
52+
/** Universally unique identifier (UUID) of a task run. */
53+
@javax.annotation.Nonnull
54+
public String getRunID() {
55+
return runID;
56+
}
57+
58+
public Event setStatus(EventStatus status) {
59+
this.status = status;
60+
return this;
61+
}
62+
63+
/** Get status */
64+
@javax.annotation.Nullable
65+
public EventStatus getStatus() {
66+
return status;
67+
}
68+
69+
public Event setType(EventType type) {
70+
this.type = type;
71+
return this;
72+
}
73+
74+
/** Get type */
75+
@javax.annotation.Nonnull
76+
public EventType getType() {
77+
return type;
78+
}
79+
80+
public Event setBatchSize(Integer batchSize) {
81+
this.batchSize = batchSize;
82+
return this;
83+
}
84+
85+
/** The extracted record batch size. minimum: 0 */
86+
@javax.annotation.Nonnull
87+
public Integer getBatchSize() {
88+
return batchSize;
89+
}
90+
91+
public Event setData(Map<String, Object> data) {
92+
this.data = data;
93+
return this;
94+
}
95+
96+
public Event putData(String key, Object dataItem) {
97+
if (this.data == null) {
98+
this.data = new HashMap<>();
99+
}
100+
this.data.put(key, dataItem);
101+
return this;
102+
}
103+
104+
/** Get data */
105+
@javax.annotation.Nullable
106+
public Map<String, Object> getData() {
107+
return data;
108+
}
109+
110+
public Event setPublishedAt(String publishedAt) {
111+
this.publishedAt = publishedAt;
112+
return this;
113+
}
114+
115+
/** Date of publish RFC 3339 format. */
116+
@javax.annotation.Nonnull
117+
public String getPublishedAt() {
118+
return publishedAt;
119+
}
120+
121+
@Override
122+
public boolean equals(Object o) {
123+
if (this == o) {
124+
return true;
125+
}
126+
if (o == null || getClass() != o.getClass()) {
127+
return false;
128+
}
129+
Event event = (Event) o;
130+
return (
131+
Objects.equals(this.eventID, event.eventID) &&
132+
Objects.equals(this.runID, event.runID) &&
133+
Objects.equals(this.status, event.status) &&
134+
Objects.equals(this.type, event.type) &&
135+
Objects.equals(this.batchSize, event.batchSize) &&
136+
Objects.equals(this.data, event.data) &&
137+
Objects.equals(this.publishedAt, event.publishedAt)
138+
);
139+
}
140+
141+
@Override
142+
public int hashCode() {
143+
return Objects.hash(eventID, runID, status, type, batchSize, data, publishedAt);
144+
}
145+
146+
@Override
147+
public String toString() {
148+
StringBuilder sb = new StringBuilder();
149+
sb.append("class Event {\n");
150+
sb.append(" eventID: ").append(toIndentedString(eventID)).append("\n");
151+
sb.append(" runID: ").append(toIndentedString(runID)).append("\n");
152+
sb.append(" status: ").append(toIndentedString(status)).append("\n");
153+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
154+
sb.append(" batchSize: ").append(toIndentedString(batchSize)).append("\n");
155+
sb.append(" data: ").append(toIndentedString(data)).append("\n");
156+
sb.append(" publishedAt: ").append(toIndentedString(publishedAt)).append("\n");
157+
sb.append("}");
158+
return sb.toString();
159+
}
160+
161+
/**
162+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
163+
*/
164+
private String toIndentedString(Object o) {
165+
if (o == null) {
166+
return "null";
167+
}
168+
return o.toString().replace("\n", "\n ");
169+
}
170+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
2+
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
package com.algolia.model.search;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import com.fasterxml.jackson.databind.annotation.*;
8+
9+
/** Gets or Sets EventStatus */
10+
public enum EventStatus {
11+
CREATED("created"),
12+
13+
STARTED("started"),
14+
15+
RETRIED("retried"),
16+
17+
FAILED("failed"),
18+
19+
SUCCEEDED("succeeded"),
20+
21+
CRITICAL("critical");
22+
23+
private final String value;
24+
25+
EventStatus(String value) {
26+
this.value = value;
27+
}
28+
29+
@JsonValue
30+
public String getValue() {
31+
return value;
32+
}
33+
34+
@Override
35+
public String toString() {
36+
return String.valueOf(value);
37+
}
38+
39+
@JsonCreator
40+
public static EventStatus fromValue(String value) {
41+
for (EventStatus b : EventStatus.values()) {
42+
if (b.value.equals(value)) {
43+
return b;
44+
}
45+
}
46+
return null;
47+
}
48+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
2+
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
package com.algolia.model.search;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import com.fasterxml.jackson.databind.annotation.*;
8+
9+
/** Gets or Sets EventType */
10+
public enum EventType {
11+
FETCH("fetch"),
12+
13+
RECORD("record"),
14+
15+
LOG("log"),
16+
17+
TRANSFORM("transform");
18+
19+
private final String value;
20+
21+
EventType(String value) {
22+
this.value = value;
23+
}
24+
25+
@JsonValue
26+
public String getValue() {
27+
return value;
28+
}
29+
30+
@Override
31+
public String toString() {
32+
return String.valueOf(value);
33+
}
34+
35+
@JsonCreator
36+
public static EventType fromValue(String value) {
37+
for (EventType b : EventType.values()) {
38+
if (b.value.equals(value)) {
39+
return b;
40+
}
41+
}
42+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
43+
}
44+
}

0 commit comments

Comments
 (0)