|
18 | 18 | import com.fasterxml.jackson.annotation.JsonInclude; |
19 | 19 | import com.fasterxml.jackson.annotation.JsonProperty; |
20 | 20 | import com.fasterxml.jackson.annotation.JsonCreator; |
| 21 | +import com.fasterxml.jackson.annotation.JsonSubTypes; |
| 22 | +import com.fasterxml.jackson.annotation.JsonTypeInfo; |
21 | 23 | import com.fasterxml.jackson.annotation.JsonTypeName; |
22 | 24 | import com.fasterxml.jackson.annotation.JsonValue; |
| 25 | +import com.openshift.cloud.api.connector.models.AddonClusterTarget; |
| 26 | +import com.openshift.cloud.api.connector.models.AddonClusterTargetAllOf; |
| 27 | +import com.openshift.cloud.api.connector.models.CloudProviderClusterTarget; |
| 28 | +import com.openshift.cloud.api.connector.models.ClusterTarget; |
23 | 29 | import io.swagger.annotations.ApiModel; |
24 | 30 | import io.swagger.annotations.ApiModelProperty; |
25 | 31 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
26 | 32 |
|
27 | 33 | /** |
28 | | - * Targets workloads to an addon cluster |
| 34 | + * AddonClusterTarget |
29 | 35 | */ |
30 | | -@ApiModel(description = "Targets workloads to an addon cluster") |
31 | 36 | @JsonPropertyOrder({ |
32 | | - AddonClusterTarget.JSON_PROPERTY_KIND, |
33 | 37 | AddonClusterTarget.JSON_PROPERTY_CLUSTER_ID |
34 | 38 | }) |
35 | 39 | @JsonTypeName("AddonClusterTarget") |
36 | 40 | @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") |
37 | | -public class AddonClusterTarget { |
38 | | - public static final String JSON_PROPERTY_KIND = "kind"; |
39 | | - private String kind; |
| 41 | +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "kind", visible = true) |
| 42 | +@JsonSubTypes({ |
| 43 | + @JsonSubTypes.Type(value = AddonClusterTarget.class, name = "addon"), |
| 44 | + @JsonSubTypes.Type(value = CloudProviderClusterTarget.class, name = "cloud_provider"), |
| 45 | +}) |
40 | 46 |
|
| 47 | +public class AddonClusterTarget extends ClusterTarget { |
41 | 48 | public static final String JSON_PROPERTY_CLUSTER_ID = "cluster_id"; |
42 | 49 | private String clusterId; |
43 | 50 |
|
44 | 51 |
|
45 | | - public AddonClusterTarget kind(String kind) { |
46 | | - |
47 | | - this.kind = kind; |
48 | | - return this; |
49 | | - } |
50 | | - |
51 | | - /** |
52 | | - * Get kind |
53 | | - * @return kind |
54 | | - **/ |
55 | | - @ApiModelProperty(required = true, value = "") |
56 | | - @JsonProperty(JSON_PROPERTY_KIND) |
57 | | - @JsonInclude(value = JsonInclude.Include.ALWAYS) |
58 | | - |
59 | | - public String getKind() { |
60 | | - return kind; |
61 | | - } |
62 | | - |
63 | | - |
64 | | - @JsonProperty(JSON_PROPERTY_KIND) |
65 | | - @JsonInclude(value = JsonInclude.Include.ALWAYS) |
66 | | - public void setKind(String kind) { |
67 | | - this.kind = kind; |
68 | | - } |
69 | | - |
70 | | - |
71 | 52 | public AddonClusterTarget clusterId(String clusterId) { |
72 | 53 |
|
73 | 54 | this.clusterId = clusterId; |
@@ -104,20 +85,20 @@ public boolean equals(Object o) { |
104 | 85 | return false; |
105 | 86 | } |
106 | 87 | AddonClusterTarget addonClusterTarget = (AddonClusterTarget) o; |
107 | | - return Objects.equals(this.kind, addonClusterTarget.kind) && |
108 | | - Objects.equals(this.clusterId, addonClusterTarget.clusterId); |
| 88 | + return Objects.equals(this.clusterId, addonClusterTarget.clusterId) && |
| 89 | + super.equals(o); |
109 | 90 | } |
110 | 91 |
|
111 | 92 | @Override |
112 | 93 | public int hashCode() { |
113 | | - return Objects.hash(kind, clusterId); |
| 94 | + return Objects.hash(clusterId, super.hashCode()); |
114 | 95 | } |
115 | 96 |
|
116 | 97 | @Override |
117 | 98 | public String toString() { |
118 | 99 | StringBuilder sb = new StringBuilder(); |
119 | 100 | sb.append("class AddonClusterTarget {\n"); |
120 | | - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); |
| 101 | + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); |
121 | 102 | sb.append(" clusterId: ").append(toIndentedString(clusterId)).append("\n"); |
122 | 103 | sb.append("}"); |
123 | 104 | return sb.toString(); |
|
0 commit comments