Skip to content

Commit bc18ca1

Browse files
algolia-botmillotp
andcommitted
feat(specs): only use shortname in the source input [skip-bc] (generated)
algolia/api-clients-automation#4287 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 998f0ac commit bc18ca1

File tree

5 files changed

+14
-195
lines changed

5 files changed

+14
-195
lines changed

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

Lines changed: 0 additions & 40 deletions
This file was deleted.

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

Lines changed: 0 additions & 40 deletions
This file was deleted.

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

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,23 @@
1111
@JsonDeserialize(as = SourceDocker.class)
1212
public class SourceDocker implements SourceInput {
1313

14-
@JsonProperty("imageType")
15-
private DockerImageType imageType;
16-
17-
@JsonProperty("registry")
18-
private DockerRegistry registry;
19-
2014
@JsonProperty("image")
2115
private String image;
2216

23-
@JsonProperty("version")
24-
private String version;
25-
2617
@JsonProperty("configuration")
2718
private Object configuration;
2819

29-
public SourceDocker setImageType(DockerImageType imageType) {
30-
this.imageType = imageType;
31-
return this;
32-
}
33-
34-
/** Get imageType */
35-
@javax.annotation.Nonnull
36-
public DockerImageType getImageType() {
37-
return imageType;
38-
}
39-
40-
public SourceDocker setRegistry(DockerRegistry registry) {
41-
this.registry = registry;
42-
return this;
43-
}
44-
45-
/** Get registry */
46-
@javax.annotation.Nonnull
47-
public DockerRegistry getRegistry() {
48-
return registry;
49-
}
50-
5120
public SourceDocker setImage(String image) {
5221
this.image = image;
5322
return this;
5423
}
5524

56-
/** Docker image name. */
25+
/** Shortname of the image, as returned by the referential. */
5726
@javax.annotation.Nonnull
5827
public String getImage() {
5928
return image;
6029
}
6130

62-
public SourceDocker setVersion(String version) {
63-
this.version = version;
64-
return this;
65-
}
66-
67-
/** Docker image version. */
68-
@javax.annotation.Nullable
69-
public String getVersion() {
70-
return version;
71-
}
72-
7331
public SourceDocker setConfiguration(Object configuration) {
7432
this.configuration = configuration;
7533
return this;
@@ -90,28 +48,19 @@ public boolean equals(Object o) {
9048
return false;
9149
}
9250
SourceDocker sourceDocker = (SourceDocker) o;
93-
return (
94-
Objects.equals(this.imageType, sourceDocker.imageType) &&
95-
Objects.equals(this.registry, sourceDocker.registry) &&
96-
Objects.equals(this.image, sourceDocker.image) &&
97-
Objects.equals(this.version, sourceDocker.version) &&
98-
Objects.equals(this.configuration, sourceDocker.configuration)
99-
);
51+
return Objects.equals(this.image, sourceDocker.image) && Objects.equals(this.configuration, sourceDocker.configuration);
10052
}
10153

10254
@Override
10355
public int hashCode() {
104-
return Objects.hash(imageType, registry, image, version, configuration);
56+
return Objects.hash(image, configuration);
10557
}
10658

10759
@Override
10860
public String toString() {
10961
StringBuilder sb = new StringBuilder();
11062
sb.append("class SourceDocker {\n");
111-
sb.append(" imageType: ").append(toIndentedString(imageType)).append("\n");
112-
sb.append(" registry: ").append(toIndentedString(registry)).append("\n");
11363
sb.append(" image: ").append(toIndentedString(image)).append("\n");
114-
sb.append(" version: ").append(toIndentedString(version)).append("\n");
11564
sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n");
11665
sb.append("}");
11766
return sb.toString();

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ class Deserializer extends JsonDeserializer<SourceInput> {
2121
@Override
2222
public SourceInput deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
2323
JsonNode tree = jp.readValueAsTree();
24-
// deserialize SourceDocker
25-
if (tree.isObject() && tree.has("registry") && tree.has("image") && tree.has("imageType") && tree.has("configuration")) {
26-
try (JsonParser parser = tree.traverse(jp.getCodec())) {
27-
return parser.readValueAs(SourceDocker.class);
28-
} catch (Exception e) {
29-
// deserialization failed, continue
30-
LOGGER.finest("Failed to deserialize oneOf SourceDocker (error: " + e.getMessage() + ") (type: SourceDocker)");
31-
}
32-
}
3324
// deserialize SourceGA4BigQueryExport
3425
if (tree.isObject() && tree.has("projectID") && tree.has("datasetID") && tree.has("tablePrefix")) {
3526
try (JsonParser parser = tree.traverse(jp.getCodec())) {
@@ -41,6 +32,15 @@ public SourceInput deserialize(JsonParser jp, DeserializationContext ctxt) throw
4132
);
4233
}
4334
}
35+
// deserialize SourceDocker
36+
if (tree.isObject() && tree.has("image") && tree.has("configuration")) {
37+
try (JsonParser parser = tree.traverse(jp.getCodec())) {
38+
return parser.readValueAs(SourceDocker.class);
39+
} catch (Exception e) {
40+
// deserialization failed, continue
41+
LOGGER.finest("Failed to deserialize oneOf SourceDocker (error: " + e.getMessage() + ") (type: SourceDocker)");
42+
}
43+
}
4444
// deserialize SourceCommercetools
4545
if (tree.isObject() && tree.has("projectKey")) {
4646
try (JsonParser parser = tree.traverse(jp.getCodec())) {

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

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,9 @@
1111
@JsonDeserialize(as = SourceUpdateDocker.class)
1212
public class SourceUpdateDocker implements SourceUpdateInput {
1313

14-
@JsonProperty("registry")
15-
private DockerRegistry registry;
16-
17-
@JsonProperty("image")
18-
private String image;
19-
20-
@JsonProperty("version")
21-
private String version;
22-
2314
@JsonProperty("configuration")
2415
private Object configuration;
2516

26-
public SourceUpdateDocker setRegistry(DockerRegistry registry) {
27-
this.registry = registry;
28-
return this;
29-
}
30-
31-
/** Get registry */
32-
@javax.annotation.Nullable
33-
public DockerRegistry getRegistry() {
34-
return registry;
35-
}
36-
37-
public SourceUpdateDocker setImage(String image) {
38-
this.image = image;
39-
return this;
40-
}
41-
42-
/** Docker image name. */
43-
@javax.annotation.Nullable
44-
public String getImage() {
45-
return image;
46-
}
47-
48-
public SourceUpdateDocker setVersion(String version) {
49-
this.version = version;
50-
return this;
51-
}
52-
53-
/** Docker image version. */
54-
@javax.annotation.Nullable
55-
public String getVersion() {
56-
return version;
57-
}
58-
5917
public SourceUpdateDocker setConfiguration(Object configuration) {
6018
this.configuration = configuration;
6119
return this;
@@ -76,26 +34,18 @@ public boolean equals(Object o) {
7634
return false;
7735
}
7836
SourceUpdateDocker sourceUpdateDocker = (SourceUpdateDocker) o;
79-
return (
80-
Objects.equals(this.registry, sourceUpdateDocker.registry) &&
81-
Objects.equals(this.image, sourceUpdateDocker.image) &&
82-
Objects.equals(this.version, sourceUpdateDocker.version) &&
83-
Objects.equals(this.configuration, sourceUpdateDocker.configuration)
84-
);
37+
return Objects.equals(this.configuration, sourceUpdateDocker.configuration);
8538
}
8639

8740
@Override
8841
public int hashCode() {
89-
return Objects.hash(registry, image, version, configuration);
42+
return Objects.hash(configuration);
9043
}
9144

9245
@Override
9346
public String toString() {
9447
StringBuilder sb = new StringBuilder();
9548
sb.append("class SourceUpdateDocker {\n");
96-
sb.append(" registry: ").append(toIndentedString(registry)).append("\n");
97-
sb.append(" image: ").append(toIndentedString(image)).append("\n");
98-
sb.append(" version: ").append(toIndentedString(version)).append("\n");
9949
sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n");
10050
sb.append("}");
10151
return sb.toString();

0 commit comments

Comments
 (0)