|
12 | 12 | import com.fasterxml.jackson.annotation.JsonInclude; |
13 | 13 | import com.fasterxml.jackson.annotation.JsonProperty; |
14 | 14 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
15 | | -import java.util.ArrayList; |
16 | 15 | import java.util.HashMap; |
17 | | -import java.util.List; |
18 | 16 | import java.util.Map; |
19 | 17 | import java.util.Objects; |
20 | 18 |
|
21 | | -/** Request body for filtering cost recommendations. */ |
22 | | -@JsonPropertyOrder({ |
23 | | - RecommendationsFilterRequest.JSON_PROPERTY_FILTER, |
24 | | - RecommendationsFilterRequest.JSON_PROPERTY_SCOPE, |
25 | | - RecommendationsFilterRequest.JSON_PROPERTY_SORT, |
26 | | - RecommendationsFilterRequest.JSON_PROPERTY_VIEW |
27 | | -}) |
| 19 | +/** JSON:API request body for filtering cost recommendations. */ |
| 20 | +@JsonPropertyOrder({RecommendationsFilterRequest.JSON_PROPERTY_DATA}) |
28 | 21 | @jakarta.annotation.Generated( |
29 | 22 | value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") |
30 | 23 | public class RecommendationsFilterRequest { |
31 | 24 | @JsonIgnore public boolean unparsed = false; |
32 | | - public static final String JSON_PROPERTY_FILTER = "filter"; |
33 | | - private String filter; |
| 25 | + public static final String JSON_PROPERTY_DATA = "data"; |
| 26 | + private RecommendationsFilterRequestData data; |
34 | 27 |
|
35 | | - public static final String JSON_PROPERTY_SCOPE = "scope"; |
36 | | - private RecommendationsFilterRequestScope scope; |
37 | | - |
38 | | - public static final String JSON_PROPERTY_SORT = "sort"; |
39 | | - private List<RecommendationsFilterRequestSortItems> sort = null; |
40 | | - |
41 | | - public static final String JSON_PROPERTY_VIEW = "view"; |
42 | | - private String view; |
43 | | - |
44 | | - public RecommendationsFilterRequest filter(String filter) { |
45 | | - this.filter = filter; |
| 28 | + public RecommendationsFilterRequest data(RecommendationsFilterRequestData data) { |
| 29 | + this.data = data; |
| 30 | + this.unparsed |= data.unparsed; |
46 | 31 | return this; |
47 | 32 | } |
48 | 33 |
|
49 | 34 | /** |
50 | | - * Filter expression applied to the recommendations. |
| 35 | + * JSON:API resource containing the cost recommendations filter. This legacy search contract uses |
| 36 | + * the resource ID for the filter expression rather than as a persistent resource identifier. |
51 | 37 | * |
52 | | - * @return filter |
| 38 | + * @return data |
53 | 39 | */ |
54 | 40 | @jakarta.annotation.Nullable |
55 | | - @JsonProperty(JSON_PROPERTY_FILTER) |
| 41 | + @JsonProperty(JSON_PROPERTY_DATA) |
56 | 42 | @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
57 | | - public String getFilter() { |
58 | | - return filter; |
59 | | - } |
60 | | - |
61 | | - public void setFilter(String filter) { |
62 | | - this.filter = filter; |
63 | | - } |
64 | | - |
65 | | - public RecommendationsFilterRequest scope(RecommendationsFilterRequestScope scope) { |
66 | | - this.scope = scope; |
67 | | - this.unparsed |= !scope.isValid(); |
68 | | - return this; |
| 43 | + public RecommendationsFilterRequestData getData() { |
| 44 | + return data; |
69 | 45 | } |
70 | 46 |
|
71 | | - /** |
72 | | - * Recommendations scope. Defaults to <code>ccm</code>; use <code>experiment</code> for |
73 | | - * experimental recommendations or <code>*</code> for both. |
74 | | - * |
75 | | - * @return scope |
76 | | - */ |
77 | | - @jakarta.annotation.Nullable |
78 | | - @JsonProperty(JSON_PROPERTY_SCOPE) |
79 | | - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
80 | | - public RecommendationsFilterRequestScope getScope() { |
81 | | - return scope; |
82 | | - } |
83 | | - |
84 | | - public void setScope(RecommendationsFilterRequestScope scope) { |
85 | | - if (!scope.isValid()) { |
86 | | - this.unparsed = true; |
87 | | - } |
88 | | - this.scope = scope; |
89 | | - } |
90 | | - |
91 | | - public RecommendationsFilterRequest sort(List<RecommendationsFilterRequestSortItems> sort) { |
92 | | - this.sort = sort; |
93 | | - if (sort != null) { |
94 | | - for (RecommendationsFilterRequestSortItems item : sort) { |
95 | | - this.unparsed |= item.unparsed; |
96 | | - } |
| 47 | + public void setData(RecommendationsFilterRequestData data) { |
| 48 | + this.data = data; |
| 49 | + if (data != null) { |
| 50 | + this.unparsed |= data.unparsed; |
97 | 51 | } |
98 | | - return this; |
99 | | - } |
100 | | - |
101 | | - public RecommendationsFilterRequest addSortItem(RecommendationsFilterRequestSortItems sortItem) { |
102 | | - if (this.sort == null) { |
103 | | - this.sort = new ArrayList<>(); |
104 | | - } |
105 | | - this.sort.add(sortItem); |
106 | | - this.unparsed |= sortItem.unparsed; |
107 | | - return this; |
108 | | - } |
109 | | - |
110 | | - /** |
111 | | - * Ordered list of sort clauses applied to the result set. |
112 | | - * |
113 | | - * @return sort |
114 | | - */ |
115 | | - @jakarta.annotation.Nullable |
116 | | - @JsonProperty(JSON_PROPERTY_SORT) |
117 | | - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
118 | | - public List<RecommendationsFilterRequestSortItems> getSort() { |
119 | | - return sort; |
120 | | - } |
121 | | - |
122 | | - public void setSort(List<RecommendationsFilterRequestSortItems> sort) { |
123 | | - this.sort = sort; |
124 | | - if (sort != null) { |
125 | | - for (RecommendationsFilterRequestSortItems item : sort) { |
126 | | - this.unparsed |= item.unparsed; |
127 | | - } |
128 | | - } |
129 | | - } |
130 | | - |
131 | | - public RecommendationsFilterRequest view(String view) { |
132 | | - this.view = view; |
133 | | - return this; |
134 | | - } |
135 | | - |
136 | | - /** |
137 | | - * Active view name (for example, <code>active</code>, <code>dismissed</code>, <code>open</code>, |
138 | | - * <code>in-progress</code>, or <code>completed</code>). |
139 | | - * |
140 | | - * @return view |
141 | | - */ |
142 | | - @jakarta.annotation.Nullable |
143 | | - @JsonProperty(JSON_PROPERTY_VIEW) |
144 | | - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
145 | | - public String getView() { |
146 | | - return view; |
147 | | - } |
148 | | - |
149 | | - public void setView(String view) { |
150 | | - this.view = view; |
151 | 52 | } |
152 | 53 |
|
153 | 54 | /** |
@@ -206,27 +107,21 @@ public boolean equals(Object o) { |
206 | 107 | return false; |
207 | 108 | } |
208 | 109 | RecommendationsFilterRequest recommendationsFilterRequest = (RecommendationsFilterRequest) o; |
209 | | - return Objects.equals(this.filter, recommendationsFilterRequest.filter) |
210 | | - && Objects.equals(this.scope, recommendationsFilterRequest.scope) |
211 | | - && Objects.equals(this.sort, recommendationsFilterRequest.sort) |
212 | | - && Objects.equals(this.view, recommendationsFilterRequest.view) |
| 110 | + return Objects.equals(this.data, recommendationsFilterRequest.data) |
213 | 111 | && Objects.equals( |
214 | 112 | this.additionalProperties, recommendationsFilterRequest.additionalProperties); |
215 | 113 | } |
216 | 114 |
|
217 | 115 | @Override |
218 | 116 | public int hashCode() { |
219 | | - return Objects.hash(filter, scope, sort, view, additionalProperties); |
| 117 | + return Objects.hash(data, additionalProperties); |
220 | 118 | } |
221 | 119 |
|
222 | 120 | @Override |
223 | 121 | public String toString() { |
224 | 122 | StringBuilder sb = new StringBuilder(); |
225 | 123 | sb.append("class RecommendationsFilterRequest {\n"); |
226 | | - sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); |
227 | | - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); |
228 | | - sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); |
229 | | - sb.append(" view: ").append(toIndentedString(view)).append("\n"); |
| 124 | + sb.append(" data: ").append(toIndentedString(data)).append("\n"); |
230 | 125 | sb.append(" additionalProperties: ") |
231 | 126 | .append(toIndentedString(additionalProperties)) |
232 | 127 | .append("\n"); |
|
0 commit comments