diff --git a/.apigentools-info b/.apigentools-info index be0e5ad108e..53f8d36fbea 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-05 18:57:52.705512", - "spec_repo_commit": "faa2c8d3" + "regenerated": "2023-10-05 20:05:32.231080", + "spec_repo_commit": "f7a95272" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-05 18:57:52.719989", - "spec_repo_commit": "faa2c8d3" + "regenerated": "2023-10-05 20:05:32.245343", + "spec_repo_commit": "f7a95272" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ee82ba9f101..0eca5ce93f5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5482,24 +5482,6 @@ components: type: string x-enum-varnames: - GCP_SERVICE_ACCOUNT - GetAllPowerpacksResponse: - description: Response object which includes all powerpack configurations. - properties: - data: - description: List of powerpack definitions. - items: - $ref: '#/components/schemas/PowerpackData' - type: array - included: - description: Array of objects related to the users. - items: - $ref: '#/components/schemas/User' - type: array - links: - $ref: '#/components/schemas/PowerpackResponseLinks' - meta: - $ref: '#/components/schemas/PowerpacksResponseMeta' - type: object GetFindingResponse: description: The expected response schema when getting a finding. properties: @@ -7677,6 +7659,24 @@ components: - data - meta type: object + ListPowerpacksResponse: + description: Response object which includes all powerpack configurations. + properties: + data: + description: List of powerpack definitions. + items: + $ref: '#/components/schemas/PowerpackData' + type: array + included: + description: Array of objects related to the users. + items: + $ref: '#/components/schemas/User' + type: array + links: + $ref: '#/components/schemas/PowerpackResponseLinks' + meta: + $ref: '#/components/schemas/PowerpacksResponseMeta' + type: object ListTeamsInclude: description: Included related resources optionally requested. enum: @@ -10596,18 +10596,7 @@ components: example: Powerpack for ABC type: string group_widget: - additionalProperties: {} - description: Templated group of dashboard widgets for the powerpack. - example: - layout_type: ordered - tags: - - tag:foo1 - type: group - widgets: - - definition: - content: example - type: note - type: object + $ref: '#/components/schemas/PowerpackGroupWidget' name: description: Name of the powerpack. example: Sample Powerpack @@ -10649,6 +10638,141 @@ components: example: powerpack type: string type: object + PowerpackGroupWidget: + description: Powerpack group widget definition object. + properties: + definition: + $ref: '#/components/schemas/PowerpackGroupWidgetDefinition' + layout: + $ref: '#/components/schemas/PowerpackGroupWidgetLayout' + required: + - definition + type: object + PowerpackGroupWidgetDefinition: + description: Powerpack group widget object. + properties: + layout_type: + description: Layout type of widgets. + example: ordered + type: string + show_title: + description: Boolean indicating whether powerpack group title should be + visible or not. + example: true + type: boolean + title: + description: Name for the group widget. + example: Sample Powerpack + type: string + type: + description: Type of widget, must be group. + example: group + type: string + widgets: + description: Widgets inside the powerpack. + example: + - definition: + content: example + type: note + layout: + height: 5 + width: 10 + x: 0 + y: 0 + items: + $ref: '#/components/schemas/PowerpackInnerWidgets' + type: array + required: + - widgets + - layout_type + - type + type: object + PowerpackGroupWidgetLayout: + description: Powerpack group widget layout. + properties: + height: + description: The height of the widget. Should be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + width: + description: The width of the widget. Should be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + x: + description: The position of the widget on the x (horizontal) axis. Should + be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + y: + description: The position of the widget on the y (vertical) axis. Should + be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + required: + - x + - y + - width + - height + type: object + PowerpackInnerWidgetLayout: + description: Powerpack inner widget layout. + properties: + height: + description: The height of the widget. Should be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + width: + description: The width of the widget. Should be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + x: + description: The position of the widget on the x (horizontal) axis. Should + be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + y: + description: The position of the widget on the y (vertical) axis. Should + be a non-negative integer. + example: 0 + format: int64 + minimum: 0 + type: integer + required: + - x + - y + - width + - height + type: object + PowerpackInnerWidgets: + description: Powerpack group widget definition of individual widgets. + properties: + definition: + additionalProperties: {} + description: Information about widget. + example: + definition: + content: example + type: note + type: object + layout: + $ref: '#/components/schemas/PowerpackInnerWidgetLayout' + required: + - definition + type: object PowerpackRelationships: description: Powerpack relationship object. properties: @@ -23570,13 +23694,13 @@ paths: /api/v2/powerpacks: get: description: Get a list of all powerpacks. - operationId: GetAllPowerpacks + operationId: ListPowerpacks responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GetAllPowerpacksResponse' + $ref: '#/components/schemas/ListPowerpacksResponse' description: OK '429': $ref: '#/components/responses/TooManyRequestsResponse' diff --git a/examples/v2/powerpack/CreatePowerpack.java b/examples/v2/powerpack/CreatePowerpack.java index 6ede18d9334..f6c2d004326 100644 --- a/examples/v2/powerpack/CreatePowerpack.java +++ b/examples/v2/powerpack/CreatePowerpack.java @@ -6,6 +6,10 @@ import com.datadog.api.client.v2.model.Powerpack; import com.datadog.api.client.v2.model.PowerpackAttributes; import com.datadog.api.client.v2.model.PowerpackData; +import com.datadog.api.client.v2.model.PowerpackGroupWidget; +import com.datadog.api.client.v2.model.PowerpackGroupWidgetDefinition; +import com.datadog.api.client.v2.model.PowerpackGroupWidgetLayout; +import com.datadog.api.client.v2.model.PowerpackInnerWidgets; import com.datadog.api.client.v2.model.PowerpackResponse; import com.datadog.api.client.v2.model.PowerpackTemplateVariable; import java.util.Collections; @@ -24,15 +28,26 @@ public static void main(String[] args) { new PowerpackAttributes() .description("Sample powerpack") .groupWidget( - Map.ofEntries( - Map.entry( - "definition", - "{'layout_type': 'ordered', 'show_title': True, 'title':" - + " 'Sample Powerpack', 'type': 'group', 'widgets':" - + " [{'definition': {'content': 'test', 'type':" - + " 'note'}}]}"), - Map.entry( - "layout", "{'height': 3, 'width': 12, 'x': 0, 'y': 0}"))) + new PowerpackGroupWidget() + .definition( + new PowerpackGroupWidgetDefinition() + .layoutType("ordered") + .showTitle(true) + .title("Sample Powerpack") + .type("group") + .widgets( + Collections.singletonList( + new PowerpackInnerWidgets() + .definition( + Map.ofEntries( + Map.entry("content", "test"), + Map.entry("type", "note")))))) + .layout( + new PowerpackGroupWidgetLayout() + .height(3L) + .width(12L) + .x(0L) + .y(0L))) .name("Sample Powerpack") .tags(Collections.singletonList("tag:sample")) .templateVariables( diff --git a/examples/v2/powerpack/GetAllPowerpacks.java b/examples/v2/powerpack/ListPowerpacks.java similarity index 75% rename from examples/v2/powerpack/GetAllPowerpacks.java rename to examples/v2/powerpack/ListPowerpacks.java index 57ee3fe5557..1272d6bbf69 100644 --- a/examples/v2/powerpack/GetAllPowerpacks.java +++ b/examples/v2/powerpack/ListPowerpacks.java @@ -3,7 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.PowerpackApi; -import com.datadog.api.client.v2.model.GetAllPowerpacksResponse; +import com.datadog.api.client.v2.model.ListPowerpacksResponse; public class Example { public static void main(String[] args) { @@ -11,10 +11,10 @@ public static void main(String[] args) { PowerpackApi apiInstance = new PowerpackApi(defaultClient); try { - GetAllPowerpacksResponse result = apiInstance.getAllPowerpacks(); + ListPowerpacksResponse result = apiInstance.listPowerpacks(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PowerpackApi#getAllPowerpacks"); + System.err.println("Exception when calling PowerpackApi#listPowerpacks"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/examples/v2/powerpack/UpdatePowerpack.java b/examples/v2/powerpack/UpdatePowerpack.java index dbf21a9d583..b1a48f0d93f 100644 --- a/examples/v2/powerpack/UpdatePowerpack.java +++ b/examples/v2/powerpack/UpdatePowerpack.java @@ -6,6 +6,10 @@ import com.datadog.api.client.v2.model.Powerpack; import com.datadog.api.client.v2.model.PowerpackAttributes; import com.datadog.api.client.v2.model.PowerpackData; +import com.datadog.api.client.v2.model.PowerpackGroupWidget; +import com.datadog.api.client.v2.model.PowerpackGroupWidgetDefinition; +import com.datadog.api.client.v2.model.PowerpackGroupWidgetLayout; +import com.datadog.api.client.v2.model.PowerpackInnerWidgets; import com.datadog.api.client.v2.model.PowerpackResponse; import com.datadog.api.client.v2.model.PowerpackTemplateVariable; import java.util.Collections; @@ -27,15 +31,26 @@ public static void main(String[] args) { new PowerpackAttributes() .description("Sample powerpack") .groupWidget( - Map.ofEntries( - Map.entry( - "definition", - "{'layout_type': 'ordered', 'show_title': True, 'title':" - + " 'Sample Powerpack', 'type': 'group', 'widgets':" - + " [{'definition': {'content': 'test', 'type':" - + " 'note'}}]}"), - Map.entry( - "layout", "{'height': 3, 'width': 12, 'x': 0, 'y': 0}"))) + new PowerpackGroupWidget() + .definition( + new PowerpackGroupWidgetDefinition() + .layoutType("ordered") + .showTitle(true) + .title("Sample Powerpack") + .type("group") + .widgets( + Collections.singletonList( + new PowerpackInnerWidgets() + .definition( + Map.ofEntries( + Map.entry("content", "test"), + Map.entry("type", "note")))))) + .layout( + new PowerpackGroupWidgetLayout() + .height(3L) + .width(12L) + .x(0L) + .y(0L))) .name("Sample Powerpack") .tags(Collections.singletonList("tag:sample")) .templateVariables( diff --git a/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java b/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java index c229ae2b85d..f798baae296 100644 --- a/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/PowerpackApi.java @@ -4,7 +4,7 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; -import com.datadog.api.client.v2.model.GetAllPowerpacksResponse; +import com.datadog.api.client.v2.model.ListPowerpacksResponse; import com.datadog.api.client.v2.model.Powerpack; import com.datadog.api.client.v2.model.PowerpackResponse; import jakarta.ws.rs.client.Invocation; @@ -309,26 +309,28 @@ public CompletableFuture> deletePowerpackWithHttpInfoAsync(Str } /** - * Get all powerpacks. + * Get a Powerpack. * - *

See {@link #getAllPowerpacksWithHttpInfo}. + *

See {@link #getPowerpackWithHttpInfo}. * - * @return GetAllPowerpacksResponse + * @param powerpackId ID of the powerpack. (required) + * @return PowerpackResponse * @throws ApiException if fails to make API call */ - public GetAllPowerpacksResponse getAllPowerpacks() throws ApiException { - return getAllPowerpacksWithHttpInfo().getData(); + public PowerpackResponse getPowerpack(String powerpackId) throws ApiException { + return getPowerpackWithHttpInfo(powerpackId).getData(); } /** - * Get all powerpacks. + * Get a Powerpack. * - *

See {@link #getAllPowerpacksWithHttpInfoAsync}. + *

See {@link #getPowerpackWithHttpInfoAsync}. * - * @return CompletableFuture<GetAllPowerpacksResponse> + * @param powerpackId ID of the powerpack. (required) + * @return CompletableFuture<PowerpackResponse> */ - public CompletableFuture getAllPowerpacksAsync() { - return getAllPowerpacksWithHttpInfoAsync() + public CompletableFuture getPowerpackAsync(String powerpackId) { + return getPowerpackWithHttpInfoAsync(powerpackId) .thenApply( response -> { return response.getData(); @@ -336,28 +338,40 @@ public CompletableFuture getAllPowerpacksAsync() { } /** - * Get a list of all powerpacks. + * Get a powerpack. * - * @return ApiResponse<GetAllPowerpacksResponse> + * @param powerpackId ID of the powerpack. (required) + * @return ApiResponse<PowerpackResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * *
Response details
Status Code Description Response Headers
200 OK -
404 Powerpack Not Found. -
429 Too many requests -
*/ - public ApiResponse getAllPowerpacksWithHttpInfo() throws ApiException { + public ApiResponse getPowerpackWithHttpInfo(String powerpackId) + throws ApiException { Object localVarPostBody = null; + + // verify the required parameter 'powerpackId' is set + if (powerpackId == null) { + throw new ApiException( + 400, "Missing the required parameter 'powerpackId' when calling getPowerpack"); + } // create path and map variables - String localVarPath = "/api/v2/powerpacks"; + String localVarPath = + "/api/v2/powerpacks/{powerpack_id}" + .replaceAll( + "\\{" + "powerpack_id" + "\\}", apiClient.escapeString(powerpackId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.PowerpackApi.getAllPowerpacks", + "v2.PowerpackApi.getPowerpack", localVarPath, new ArrayList(), localVarHeaderParams, @@ -372,21 +386,34 @@ public ApiResponse getAllPowerpacksWithHttpInfo() thro localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all powerpacks. + * Get a Powerpack. * - *

See {@link #getAllPowerpacksWithHttpInfo}. + *

See {@link #getPowerpackWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<GetAllPowerpacksResponse>> + * @param powerpackId ID of the powerpack. (required) + * @return CompletableFuture<ApiResponse<PowerpackResponse>> */ - public CompletableFuture> - getAllPowerpacksWithHttpInfoAsync() { + public CompletableFuture> getPowerpackWithHttpInfoAsync( + String powerpackId) { Object localVarPostBody = null; + + // verify the required parameter 'powerpackId' is set + if (powerpackId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'powerpackId' when calling getPowerpack")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/powerpacks"; + String localVarPath = + "/api/v2/powerpacks/{powerpack_id}" + .replaceAll( + "\\{" + "powerpack_id" + "\\}", apiClient.escapeString(powerpackId.toString())); Map localVarHeaderParams = new HashMap(); @@ -394,7 +421,7 @@ public ApiResponse getAllPowerpacksWithHttpInfo() thro try { builder = apiClient.createBuilder( - "v2.PowerpackApi.getAllPowerpacks", + "v2.PowerpackApi.getPowerpack", localVarPath, new ArrayList(), localVarHeaderParams, @@ -402,7 +429,7 @@ public ApiResponse getAllPowerpacksWithHttpInfo() thro new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -414,32 +441,30 @@ public ApiResponse getAllPowerpacksWithHttpInfo() thro localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a Powerpack. + * Get all powerpacks. * - *

See {@link #getPowerpackWithHttpInfo}. + *

See {@link #listPowerpacksWithHttpInfo}. * - * @param powerpackId ID of the powerpack. (required) - * @return PowerpackResponse + * @return ListPowerpacksResponse * @throws ApiException if fails to make API call */ - public PowerpackResponse getPowerpack(String powerpackId) throws ApiException { - return getPowerpackWithHttpInfo(powerpackId).getData(); + public ListPowerpacksResponse listPowerpacks() throws ApiException { + return listPowerpacksWithHttpInfo().getData(); } /** - * Get a Powerpack. + * Get all powerpacks. * - *

See {@link #getPowerpackWithHttpInfoAsync}. + *

See {@link #listPowerpacksWithHttpInfoAsync}. * - * @param powerpackId ID of the powerpack. (required) - * @return CompletableFuture<PowerpackResponse> + * @return CompletableFuture<ListPowerpacksResponse> */ - public CompletableFuture getPowerpackAsync(String powerpackId) { - return getPowerpackWithHttpInfoAsync(powerpackId) + public CompletableFuture listPowerpacksAsync() { + return listPowerpacksWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -447,40 +472,28 @@ public CompletableFuture getPowerpackAsync(String powerpackId } /** - * Get a powerpack. + * Get a list of all powerpacks. * - * @param powerpackId ID of the powerpack. (required) - * @return ApiResponse<PowerpackResponse> + * @return ApiResponse<ListPowerpacksResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * *
Response details
Status Code Description Response Headers
200 OK -
404 Powerpack Not Found. -
429 Too many requests -
*/ - public ApiResponse getPowerpackWithHttpInfo(String powerpackId) - throws ApiException { + public ApiResponse listPowerpacksWithHttpInfo() throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'powerpackId' is set - if (powerpackId == null) { - throw new ApiException( - 400, "Missing the required parameter 'powerpackId' when calling getPowerpack"); - } // create path and map variables - String localVarPath = - "/api/v2/powerpacks/{powerpack_id}" - .replaceAll( - "\\{" + "powerpack_id" + "\\}", apiClient.escapeString(powerpackId.toString())); + String localVarPath = "/api/v2/powerpacks"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.PowerpackApi.getPowerpack", + "v2.PowerpackApi.listPowerpacks", localVarPath, new ArrayList(), localVarHeaderParams, @@ -495,34 +508,20 @@ public ApiResponse getPowerpackWithHttpInfo(String powerpackI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a Powerpack. + * Get all powerpacks. * - *

See {@link #getPowerpackWithHttpInfo}. + *

See {@link #listPowerpacksWithHttpInfo}. * - * @param powerpackId ID of the powerpack. (required) - * @return CompletableFuture<ApiResponse<PowerpackResponse>> + * @return CompletableFuture<ApiResponse<ListPowerpacksResponse>> */ - public CompletableFuture> getPowerpackWithHttpInfoAsync( - String powerpackId) { + public CompletableFuture> listPowerpacksWithHttpInfoAsync() { Object localVarPostBody = null; - - // verify the required parameter 'powerpackId' is set - if (powerpackId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'powerpackId' when calling getPowerpack")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/powerpacks/{powerpack_id}" - .replaceAll( - "\\{" + "powerpack_id" + "\\}", apiClient.escapeString(powerpackId.toString())); + String localVarPath = "/api/v2/powerpacks"; Map localVarHeaderParams = new HashMap(); @@ -530,7 +529,7 @@ public CompletableFuture> getPowerpackWithHttpInf try { builder = apiClient.createBuilder( - "v2.PowerpackApi.getPowerpack", + "v2.PowerpackApi.listPowerpacks", localVarPath, new ArrayList(), localVarHeaderParams, @@ -538,7 +537,7 @@ public CompletableFuture> getPowerpackWithHttpInf new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -550,7 +549,7 @@ public CompletableFuture> getPowerpackWithHttpInf localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** diff --git a/src/main/java/com/datadog/api/client/v2/model/GetAllPowerpacksResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListPowerpacksResponse.java similarity index 81% rename from src/main/java/com/datadog/api/client/v2/model/GetAllPowerpacksResponse.java rename to src/main/java/com/datadog/api/client/v2/model/ListPowerpacksResponse.java index 42a7d202e12..0c9dc0c64b0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/GetAllPowerpacksResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/ListPowerpacksResponse.java @@ -20,14 +20,14 @@ /** Response object which includes all powerpack configurations. */ @JsonPropertyOrder({ - GetAllPowerpacksResponse.JSON_PROPERTY_DATA, - GetAllPowerpacksResponse.JSON_PROPERTY_INCLUDED, - GetAllPowerpacksResponse.JSON_PROPERTY_LINKS, - GetAllPowerpacksResponse.JSON_PROPERTY_META + ListPowerpacksResponse.JSON_PROPERTY_DATA, + ListPowerpacksResponse.JSON_PROPERTY_INCLUDED, + ListPowerpacksResponse.JSON_PROPERTY_LINKS, + ListPowerpacksResponse.JSON_PROPERTY_META }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class GetAllPowerpacksResponse { +public class ListPowerpacksResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; private List data = null; @@ -41,7 +41,7 @@ public class GetAllPowerpacksResponse { public static final String JSON_PROPERTY_META = "meta"; private PowerpacksResponseMeta meta; - public GetAllPowerpacksResponse data(List data) { + public ListPowerpacksResponse data(List data) { this.data = data; for (PowerpackData item : data) { this.unparsed |= item.unparsed; @@ -49,7 +49,7 @@ public GetAllPowerpacksResponse data(List data) { return this; } - public GetAllPowerpacksResponse addDataItem(PowerpackData dataItem) { + public ListPowerpacksResponse addDataItem(PowerpackData dataItem) { if (this.data == null) { this.data = new ArrayList<>(); } @@ -74,7 +74,7 @@ public void setData(List data) { this.data = data; } - public GetAllPowerpacksResponse included(List included) { + public ListPowerpacksResponse included(List included) { this.included = included; for (User item : included) { this.unparsed |= item.unparsed; @@ -82,7 +82,7 @@ public GetAllPowerpacksResponse included(List included) { return this; } - public GetAllPowerpacksResponse addIncludedItem(User includedItem) { + public ListPowerpacksResponse addIncludedItem(User includedItem) { if (this.included == null) { this.included = new ArrayList<>(); } @@ -107,7 +107,7 @@ public void setIncluded(List included) { this.included = included; } - public GetAllPowerpacksResponse links(PowerpackResponseLinks links) { + public ListPowerpacksResponse links(PowerpackResponseLinks links) { this.links = links; this.unparsed |= links.unparsed; return this; @@ -129,7 +129,7 @@ public void setLinks(PowerpackResponseLinks links) { this.links = links; } - public GetAllPowerpacksResponse meta(PowerpacksResponseMeta meta) { + public ListPowerpacksResponse meta(PowerpacksResponseMeta meta) { this.meta = meta; this.unparsed |= meta.unparsed; return this; @@ -163,10 +163,10 @@ public void setMeta(PowerpacksResponseMeta meta) { * * @param key The arbitrary key to set * @param value The associated value - * @return GetAllPowerpacksResponse + * @return ListPowerpacksResponse */ @JsonAnySetter - public GetAllPowerpacksResponse putAdditionalProperty(String key, Object value) { + public ListPowerpacksResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -197,7 +197,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this GetAllPowerpacksResponse object is equal to o. */ + /** Return true if this ListPowerpacksResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -206,12 +206,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetAllPowerpacksResponse getAllPowerpacksResponse = (GetAllPowerpacksResponse) o; - return Objects.equals(this.data, getAllPowerpacksResponse.data) - && Objects.equals(this.included, getAllPowerpacksResponse.included) - && Objects.equals(this.links, getAllPowerpacksResponse.links) - && Objects.equals(this.meta, getAllPowerpacksResponse.meta) - && Objects.equals(this.additionalProperties, getAllPowerpacksResponse.additionalProperties); + ListPowerpacksResponse listPowerpacksResponse = (ListPowerpacksResponse) o; + return Objects.equals(this.data, listPowerpacksResponse.data) + && Objects.equals(this.included, listPowerpacksResponse.included) + && Objects.equals(this.links, listPowerpacksResponse.links) + && Objects.equals(this.meta, listPowerpacksResponse.meta) + && Objects.equals(this.additionalProperties, listPowerpacksResponse.additionalProperties); } @Override @@ -222,7 +222,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetAllPowerpacksResponse {\n"); + sb.append("class ListPowerpacksResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" included: ").append(toIndentedString(included)).append("\n"); sb.append(" links: ").append(toIndentedString(links)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackAttributes.java index 263664c84fa..f98bdc6931a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PowerpackAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackAttributes.java @@ -35,7 +35,7 @@ public class PowerpackAttributes { private String description; public static final String JSON_PROPERTY_GROUP_WIDGET = "group_widget"; - private Map groupWidget = new HashMap(); + private PowerpackGroupWidget groupWidget; public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -51,9 +51,10 @@ public PowerpackAttributes() {} @JsonCreator public PowerpackAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_WIDGET) - Map groupWidget, + PowerpackGroupWidget groupWidget, @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { this.groupWidget = groupWidget; + this.unparsed |= groupWidget.unparsed; this.name = name; } @@ -78,28 +79,24 @@ public void setDescription(String description) { this.description = description; } - public PowerpackAttributes groupWidget(Map groupWidget) { + public PowerpackAttributes groupWidget(PowerpackGroupWidget groupWidget) { this.groupWidget = groupWidget; - return this; - } - - public PowerpackAttributes putGroupWidgetItem(String key, Object groupWidgetItem) { - this.groupWidget.put(key, groupWidgetItem); + this.unparsed |= groupWidget.unparsed; return this; } /** - * Templated group of dashboard widgets for the powerpack. + * Powerpack group widget definition object. * * @return groupWidget */ @JsonProperty(JSON_PROPERTY_GROUP_WIDGET) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Map getGroupWidget() { + public PowerpackGroupWidget getGroupWidget() { return groupWidget; } - public void setGroupWidget(Map groupWidget) { + public void setGroupWidget(PowerpackGroupWidget groupWidget) { this.groupWidget = groupWidget; } diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidget.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidget.java new file mode 100644 index 00000000000..4335f6f9e09 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidget.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Powerpack group widget definition object. */ +@JsonPropertyOrder({ + PowerpackGroupWidget.JSON_PROPERTY_DEFINITION, + PowerpackGroupWidget.JSON_PROPERTY_LAYOUT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PowerpackGroupWidget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private PowerpackGroupWidgetDefinition definition; + + public static final String JSON_PROPERTY_LAYOUT = "layout"; + private PowerpackGroupWidgetLayout layout; + + public PowerpackGroupWidget() {} + + @JsonCreator + public PowerpackGroupWidget( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) + PowerpackGroupWidgetDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + } + + public PowerpackGroupWidget definition(PowerpackGroupWidgetDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + return this; + } + + /** + * Powerpack group widget object. + * + * @return definition + */ + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PowerpackGroupWidgetDefinition getDefinition() { + return definition; + } + + public void setDefinition(PowerpackGroupWidgetDefinition definition) { + this.definition = definition; + } + + public PowerpackGroupWidget layout(PowerpackGroupWidgetLayout layout) { + this.layout = layout; + this.unparsed |= layout.unparsed; + return this; + } + + /** + * Powerpack group widget layout. + * + * @return layout + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PowerpackGroupWidgetLayout getLayout() { + return layout; + } + + public void setLayout(PowerpackGroupWidgetLayout layout) { + this.layout = layout; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PowerpackGroupWidget + */ + @JsonAnySetter + public PowerpackGroupWidget putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PowerpackGroupWidget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PowerpackGroupWidget powerpackGroupWidget = (PowerpackGroupWidget) o; + return Objects.equals(this.definition, powerpackGroupWidget.definition) + && Objects.equals(this.layout, powerpackGroupWidget.layout) + && Objects.equals(this.additionalProperties, powerpackGroupWidget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(definition, layout, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PowerpackGroupWidget {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetDefinition.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetDefinition.java new file mode 100644 index 00000000000..858380b7867 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetDefinition.java @@ -0,0 +1,269 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Powerpack group widget object. */ +@JsonPropertyOrder({ + PowerpackGroupWidgetDefinition.JSON_PROPERTY_LAYOUT_TYPE, + PowerpackGroupWidgetDefinition.JSON_PROPERTY_SHOW_TITLE, + PowerpackGroupWidgetDefinition.JSON_PROPERTY_TITLE, + PowerpackGroupWidgetDefinition.JSON_PROPERTY_TYPE, + PowerpackGroupWidgetDefinition.JSON_PROPERTY_WIDGETS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PowerpackGroupWidgetDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LAYOUT_TYPE = "layout_type"; + private String layoutType; + + public static final String JSON_PROPERTY_SHOW_TITLE = "show_title"; + private Boolean showTitle; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_WIDGETS = "widgets"; + private List widgets = new ArrayList<>(); + + public PowerpackGroupWidgetDefinition() {} + + @JsonCreator + public PowerpackGroupWidgetDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_LAYOUT_TYPE) String layoutType, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type, + @JsonProperty(required = true, value = JSON_PROPERTY_WIDGETS) + List widgets) { + this.layoutType = layoutType; + this.type = type; + this.widgets = widgets; + } + + public PowerpackGroupWidgetDefinition layoutType(String layoutType) { + this.layoutType = layoutType; + return this; + } + + /** + * Layout type of widgets. + * + * @return layoutType + */ + @JsonProperty(JSON_PROPERTY_LAYOUT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLayoutType() { + return layoutType; + } + + public void setLayoutType(String layoutType) { + this.layoutType = layoutType; + } + + public PowerpackGroupWidgetDefinition showTitle(Boolean showTitle) { + this.showTitle = showTitle; + return this; + } + + /** + * Boolean indicating whether powerpack group title should be visible or not. + * + * @return showTitle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowTitle() { + return showTitle; + } + + public void setShowTitle(Boolean showTitle) { + this.showTitle = showTitle; + } + + public PowerpackGroupWidgetDefinition title(String title) { + this.title = title; + return this; + } + + /** + * Name for the group widget. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public PowerpackGroupWidgetDefinition type(String type) { + this.type = type; + return this; + } + + /** + * Type of widget, must be group. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PowerpackGroupWidgetDefinition widgets(List widgets) { + this.widgets = widgets; + for (PowerpackInnerWidgets item : widgets) { + this.unparsed |= item.unparsed; + } + return this; + } + + public PowerpackGroupWidgetDefinition addWidgetsItem(PowerpackInnerWidgets widgetsItem) { + this.widgets.add(widgetsItem); + this.unparsed |= widgetsItem.unparsed; + return this; + } + + /** + * Widgets inside the powerpack. + * + * @return widgets + */ + @JsonProperty(JSON_PROPERTY_WIDGETS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getWidgets() { + return widgets; + } + + public void setWidgets(List widgets) { + this.widgets = widgets; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PowerpackGroupWidgetDefinition + */ + @JsonAnySetter + public PowerpackGroupWidgetDefinition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PowerpackGroupWidgetDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PowerpackGroupWidgetDefinition powerpackGroupWidgetDefinition = + (PowerpackGroupWidgetDefinition) o; + return Objects.equals(this.layoutType, powerpackGroupWidgetDefinition.layoutType) + && Objects.equals(this.showTitle, powerpackGroupWidgetDefinition.showTitle) + && Objects.equals(this.title, powerpackGroupWidgetDefinition.title) + && Objects.equals(this.type, powerpackGroupWidgetDefinition.type) + && Objects.equals(this.widgets, powerpackGroupWidgetDefinition.widgets) + && Objects.equals( + this.additionalProperties, powerpackGroupWidgetDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(layoutType, showTitle, title, type, widgets, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PowerpackGroupWidgetDefinition {\n"); + sb.append(" layoutType: ").append(toIndentedString(layoutType)).append("\n"); + sb.append(" showTitle: ").append(toIndentedString(showTitle)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" widgets: ").append(toIndentedString(widgets)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetLayout.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetLayout.java new file mode 100644 index 00000000000..b61813d1488 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackGroupWidgetLayout.java @@ -0,0 +1,232 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Powerpack group widget layout. */ +@JsonPropertyOrder({ + PowerpackGroupWidgetLayout.JSON_PROPERTY_HEIGHT, + PowerpackGroupWidgetLayout.JSON_PROPERTY_WIDTH, + PowerpackGroupWidgetLayout.JSON_PROPERTY_X, + PowerpackGroupWidgetLayout.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PowerpackGroupWidgetLayout { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Long height; + + public static final String JSON_PROPERTY_WIDTH = "width"; + private Long width; + + public static final String JSON_PROPERTY_X = "x"; + private Long x; + + public static final String JSON_PROPERTY_Y = "y"; + private Long y; + + public PowerpackGroupWidgetLayout() {} + + @JsonCreator + public PowerpackGroupWidgetLayout( + @JsonProperty(required = true, value = JSON_PROPERTY_HEIGHT) Long height, + @JsonProperty(required = true, value = JSON_PROPERTY_WIDTH) Long width, + @JsonProperty(required = true, value = JSON_PROPERTY_X) Long x, + @JsonProperty(required = true, value = JSON_PROPERTY_Y) Long y) { + this.height = height; + this.width = width; + this.x = x; + this.y = y; + } + + public PowerpackGroupWidgetLayout height(Long height) { + this.height = height; + return this; + } + + /** + * The height of the widget. Should be a non-negative integer. minimum: 0 + * + * @return height + */ + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getHeight() { + return height; + } + + public void setHeight(Long height) { + this.height = height; + } + + public PowerpackGroupWidgetLayout width(Long width) { + this.width = width; + return this; + } + + /** + * The width of the widget. Should be a non-negative integer. minimum: 0 + * + * @return width + */ + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getWidth() { + return width; + } + + public void setWidth(Long width) { + this.width = width; + } + + public PowerpackGroupWidgetLayout x(Long x) { + this.x = x; + return this; + } + + /** + * The position of the widget on the x (horizontal) axis. Should be a non-negative integer. + * minimum: 0 + * + * @return x + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getX() { + return x; + } + + public void setX(Long x) { + this.x = x; + } + + public PowerpackGroupWidgetLayout y(Long y) { + this.y = y; + return this; + } + + /** + * The position of the widget on the y (vertical) axis. Should be a non-negative integer. minimum: + * 0 + * + * @return y + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getY() { + return y; + } + + public void setY(Long y) { + this.y = y; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PowerpackGroupWidgetLayout + */ + @JsonAnySetter + public PowerpackGroupWidgetLayout putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PowerpackGroupWidgetLayout object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PowerpackGroupWidgetLayout powerpackGroupWidgetLayout = (PowerpackGroupWidgetLayout) o; + return Objects.equals(this.height, powerpackGroupWidgetLayout.height) + && Objects.equals(this.width, powerpackGroupWidgetLayout.width) + && Objects.equals(this.x, powerpackGroupWidgetLayout.x) + && Objects.equals(this.y, powerpackGroupWidgetLayout.y) + && Objects.equals( + this.additionalProperties, powerpackGroupWidgetLayout.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(height, width, x, y, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PowerpackGroupWidgetLayout {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgetLayout.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgetLayout.java new file mode 100644 index 00000000000..7952bdcb9c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgetLayout.java @@ -0,0 +1,232 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Powerpack inner widget layout. */ +@JsonPropertyOrder({ + PowerpackInnerWidgetLayout.JSON_PROPERTY_HEIGHT, + PowerpackInnerWidgetLayout.JSON_PROPERTY_WIDTH, + PowerpackInnerWidgetLayout.JSON_PROPERTY_X, + PowerpackInnerWidgetLayout.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PowerpackInnerWidgetLayout { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Long height; + + public static final String JSON_PROPERTY_WIDTH = "width"; + private Long width; + + public static final String JSON_PROPERTY_X = "x"; + private Long x; + + public static final String JSON_PROPERTY_Y = "y"; + private Long y; + + public PowerpackInnerWidgetLayout() {} + + @JsonCreator + public PowerpackInnerWidgetLayout( + @JsonProperty(required = true, value = JSON_PROPERTY_HEIGHT) Long height, + @JsonProperty(required = true, value = JSON_PROPERTY_WIDTH) Long width, + @JsonProperty(required = true, value = JSON_PROPERTY_X) Long x, + @JsonProperty(required = true, value = JSON_PROPERTY_Y) Long y) { + this.height = height; + this.width = width; + this.x = x; + this.y = y; + } + + public PowerpackInnerWidgetLayout height(Long height) { + this.height = height; + return this; + } + + /** + * The height of the widget. Should be a non-negative integer. minimum: 0 + * + * @return height + */ + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getHeight() { + return height; + } + + public void setHeight(Long height) { + this.height = height; + } + + public PowerpackInnerWidgetLayout width(Long width) { + this.width = width; + return this; + } + + /** + * The width of the widget. Should be a non-negative integer. minimum: 0 + * + * @return width + */ + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getWidth() { + return width; + } + + public void setWidth(Long width) { + this.width = width; + } + + public PowerpackInnerWidgetLayout x(Long x) { + this.x = x; + return this; + } + + /** + * The position of the widget on the x (horizontal) axis. Should be a non-negative integer. + * minimum: 0 + * + * @return x + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getX() { + return x; + } + + public void setX(Long x) { + this.x = x; + } + + public PowerpackInnerWidgetLayout y(Long y) { + this.y = y; + return this; + } + + /** + * The position of the widget on the y (vertical) axis. Should be a non-negative integer. minimum: + * 0 + * + * @return y + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getY() { + return y; + } + + public void setY(Long y) { + this.y = y; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PowerpackInnerWidgetLayout + */ + @JsonAnySetter + public PowerpackInnerWidgetLayout putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PowerpackInnerWidgetLayout object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PowerpackInnerWidgetLayout powerpackInnerWidgetLayout = (PowerpackInnerWidgetLayout) o; + return Objects.equals(this.height, powerpackInnerWidgetLayout.height) + && Objects.equals(this.width, powerpackInnerWidgetLayout.width) + && Objects.equals(this.x, powerpackInnerWidgetLayout.x) + && Objects.equals(this.y, powerpackInnerWidgetLayout.y) + && Objects.equals( + this.additionalProperties, powerpackInnerWidgetLayout.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(height, width, x, y, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PowerpackInnerWidgetLayout {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgets.java b/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgets.java new file mode 100644 index 00000000000..24c057d2b24 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PowerpackInnerWidgets.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Powerpack group widget definition of individual widgets. */ +@JsonPropertyOrder({ + PowerpackInnerWidgets.JSON_PROPERTY_DEFINITION, + PowerpackInnerWidgets.JSON_PROPERTY_LAYOUT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PowerpackInnerWidgets { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private Map definition = new HashMap(); + + public static final String JSON_PROPERTY_LAYOUT = "layout"; + private PowerpackInnerWidgetLayout layout; + + public PowerpackInnerWidgets() {} + + @JsonCreator + public PowerpackInnerWidgets( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) + Map definition) { + this.definition = definition; + } + + public PowerpackInnerWidgets definition(Map definition) { + this.definition = definition; + return this; + } + + public PowerpackInnerWidgets putDefinitionItem(String key, Object definitionItem) { + this.definition.put(key, definitionItem); + return this; + } + + /** + * Information about widget. + * + * @return definition + */ + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getDefinition() { + return definition; + } + + public void setDefinition(Map definition) { + this.definition = definition; + } + + public PowerpackInnerWidgets layout(PowerpackInnerWidgetLayout layout) { + this.layout = layout; + this.unparsed |= layout.unparsed; + return this; + } + + /** + * Powerpack inner widget layout. + * + * @return layout + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAYOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PowerpackInnerWidgetLayout getLayout() { + return layout; + } + + public void setLayout(PowerpackInnerWidgetLayout layout) { + this.layout = layout; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PowerpackInnerWidgets + */ + @JsonAnySetter + public PowerpackInnerWidgets putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PowerpackInnerWidgets object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PowerpackInnerWidgets powerpackInnerWidgets = (PowerpackInnerWidgets) o; + return Objects.equals(this.definition, powerpackInnerWidgets.definition) + && Objects.equals(this.layout, powerpackInnerWidgets.layout) + && Objects.equals(this.additionalProperties, powerpackInnerWidgets.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(definition, layout, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PowerpackInnerWidgets {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.freeze index 8de3b1c8fe4..572764c79fa 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2023-09-19T20:34:17.937Z \ No newline at end of file +2023-10-05T15:56:23.491Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.json index e4a629e5bf4..9899dd2b3ef 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"description\":\"Powerpack for ABC\",\"group_widget\":{\"layout_type\":\"ordered\",\"tags\":[\"tag:foo1\"],\"type\":\"group\",\"widgets\":[{\"definition\":{\"content\":\"example\",\"type\":\"note\"}}]},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:foo1\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"test\"}]},\"type\":\"powerpack\"}}" + "json": "{\"data\":{\"attributes\":{\"description\":\"Powerpack for ABC\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"type\":\"group1\",\"widgets\":[]}},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:foo1\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"test\"}]},\"type\":\"powerpack\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"Invalid group widget for powerpack. Error: 'type' is a required property\\n\\nFailed validating 'required' in schema:\\n {'additionalProperties': False,\\n 'properties': {'background_color': {'type': 'string'},\\n 'banner_img': {'type': 'string'},\\n 'layout_type': {'enum': ['ordered']},\\n 'reflow_type': {'enum': ['auto', 'fixed']},\\n 'show_title': {'type': 'boolean'},\\n 'title': {'type': 'string'},\\n 'title_align': {'enum': ['center', 'left', 'right']},\\n 'type': {'enum': ['group']},\\n 'widgets': {'items': {'additionalProperties': False,\\n 'properties': {'definition': {'additionalProperties': True,\\n 'properties': {'type': {'enum': ['alert_graph',\\n 'alert_value',\\n 'change',\\n 'check_status',\\n 'distribution',\\n 'geomap',\\n 'heatmap',\\n 'hostmap',\\n 'note',\\n 'query_value',\\n 'scatterplot',\\n 'servicemap',\\n 'topology_map',\\n 'query_table',\\n 'timeseries',\\n 'toplist',\\n 'list_stream',\\n 'treemap',\\n 'uptime',\\n 'slo',\\n 'funnel',\\n 'custom',\\n 'experimental',\\n 'sunburst',\\n 'wildcard',\\n 'slo_list',\\n 'flame_graph',\\n 'run_workflow',\\n 'embedded_app',\\n 'log_stream',\\n 'iframe',\\n 'free_text',\\n 'event_stream',\\n 'event_timeline',\\n 'manage_status',\\n 'trace_service',\\n 'image']}},\\n 'required': ['type'],\\n 'type': 'object'},\\n 'id': {'type': 'integer'},\\n 'layout': {'additionalProperties': False,\\n 'properties': {'height': {'type': 'number'},\\n 'is_column_break': {'type': 'boolean'},\\n 'width': {'type': 'number'},\\n 'x': {'type': 'number'},\\n 'y': {'type': 'number'}},\\n 'type': 'object'}},\\n 'required': ['definition'],\\n 'type': 'object'},\\n 'type': 'array'}},\\n 'required': ['type', 'layout_type', 'widgets'],\\n 'type': 'object'}\\n\\nOn instance:\\n {}.\"]}", + "body": "{\"errors\":[\"Invalid group widget for powerpack. Error: 'group1' is not one of ['group']\\n\\nFailed validating 'enum' in schema['properties']['type']:\\n {'enum': ['group']}\\n\\nOn instance['type']:\\n 'group1'.\"]}", "headers": { "Content-Type": [ "application/json" @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "630c2e80-3760-76a0-5ffe-904dbebb7715" + "id": "0011486f-1e30-c652-72fb-909e4c526536" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.freeze index 6636089c7a2..8693788b95e 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2023-09-19T20:34:19.633Z \ No newline at end of file +2023-10-04T19:18:49.142Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.json index 2a12af03e77..9692be75d04 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_new_powerpack_with_missing_group_widget_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"description\":\"Sample powerpack\",\"group_widget\":{},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:sample\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}]},\"type\":\"powerpack\"}}" + "json": "{\"data\":{\"attributes\":{\"description\":\"Sample powerpack\",\"name\":\"Sample Powerpack\",\"tags\":[\"tag:sample\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}]},\"type\":\"powerpack\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"Invalid group widget for powerpack. Error: 'type' is a required property\\n\\nFailed validating 'required' in schema:\\n {'additionalProperties': False,\\n 'properties': {'background_color': {'type': 'string'},\\n 'banner_img': {'type': 'string'},\\n 'layout_type': {'enum': ['ordered']},\\n 'reflow_type': {'enum': ['auto', 'fixed']},\\n 'show_title': {'type': 'boolean'},\\n 'title': {'type': 'string'},\\n 'title_align': {'enum': ['center', 'left', 'right']},\\n 'type': {'enum': ['group']},\\n 'widgets': {'items': {'additionalProperties': False,\\n 'properties': {'definition': {'additionalProperties': True,\\n 'properties': {'type': {'enum': ['alert_graph',\\n 'alert_value',\\n 'change',\\n 'check_status',\\n 'distribution',\\n 'geomap',\\n 'heatmap',\\n 'hostmap',\\n 'note',\\n 'query_value',\\n 'scatterplot',\\n 'servicemap',\\n 'topology_map',\\n 'query_table',\\n 'timeseries',\\n 'toplist',\\n 'list_stream',\\n 'treemap',\\n 'uptime',\\n 'slo',\\n 'funnel',\\n 'custom',\\n 'experimental',\\n 'sunburst',\\n 'wildcard',\\n 'slo_list',\\n 'flame_graph',\\n 'run_workflow',\\n 'embedded_app',\\n 'log_stream',\\n 'iframe',\\n 'free_text',\\n 'event_stream',\\n 'event_timeline',\\n 'manage_status',\\n 'trace_service',\\n 'image']}},\\n 'required': ['type'],\\n 'type': 'object'},\\n 'id': {'type': 'integer'},\\n 'layout': {'additionalProperties': False,\\n 'properties': {'height': {'type': 'number'},\\n 'is_column_break': {'type': 'boolean'},\\n 'width': {'type': 'number'},\\n 'x': {'type': 'number'},\\n 'y': {'type': 'number'}},\\n 'type': 'object'}},\\n 'required': ['definition'],\\n 'type': 'object'},\\n 'type': 'array'}},\\n 'required': ['type', 'layout_type', 'widgets'],\\n 'type': 'object'}\\n\\nOn instance:\\n {}.\"]}", + "body": "{\"errors\":[\"API input validation failed: {'group_widget': ['Missing data for required field.']}\"]}", "headers": { "Content-Type": [ "application/json" @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "31c2a8a0-5199-0082-dd7d-db3b69fc2c6f" + "id": "f021390d-fd49-dd16-ff7f-d2c54f639c0e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.freeze index d30592128ac..8d5b8f21651 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2023-09-19T20:34:23.150Z \ No newline at end of file +2023-10-05T15:56:24.178Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.json index e13d90a9bc7..cd7d3dbf842 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_powerpack_returns_Bad_Request_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"powerpack\",\"id\":\"eb0c0428-572b-11ee-92ec-da7ad0900002\",\"attributes\":{\"name\":\"Sample Powerpack\",\"description\":\"Sample powerpack\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"show_title\":true,\"title\":\"Sample Powerpack\",\"type\":\"group\",\"widgets\":[{\"definition\":{\"content\":\"test\",\"type\":\"note\"},\"id\":8888289347240039}]},\"layout\":{\"height\":3,\"width\":12,\"x\":0,\"y\":0}},\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}],\"tags\":[\"tag:sample\"]},\"relationships\":{\"author\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"email\":\"frog@datadoghq.com\"}}]}\n", + "body": "{\"data\":{\"type\":\"powerpack\",\"id\":\"bc22abe4-6397-11ee-865e-da7ad0900002\",\"attributes\":{\"name\":\"Sample Powerpack\",\"description\":\"Sample powerpack\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"show_title\":true,\"title\":\"Sample Powerpack\",\"type\":\"group\",\"widgets\":[{\"definition\":{\"content\":\"test\",\"type\":\"note\"},\"id\":1043184765896296}]},\"layout\":{\"height\":3,\"width\":12,\"x\":0,\"y\":0}},\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}],\"tags\":[\"tag:sample\"]},\"relationships\":{\"author\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"attributes\":{\"name\":\"CI Account\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"}}]}\n", "headers": { "Content-Type": [ "application/json" @@ -33,16 +33,16 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"description\":\"Sample powerpack\",\"group_widget\":{},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:sample\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}]},\"type\":\"powerpack\"}}" + "json": "{\"data\":{\"attributes\":{\"description\":\"Sample powerpack\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"type\":\"group1\",\"widgets\":[]}},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:sample\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}]},\"type\":\"powerpack\"}}" }, "headers": {}, "method": "PATCH", - "path": "/api/v2/powerpacks/eb0c0428-572b-11ee-92ec-da7ad0900002", + "path": "/api/v2/powerpacks/bc22abe4-6397-11ee-865e-da7ad0900002", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"Invalid group widget for powerpack. Error: 'type' is a required property\\n\\nFailed validating 'required' in schema:\\n {'additionalProperties': False,\\n 'properties': {'background_color': {'type': 'string'},\\n 'banner_img': {'type': 'string'},\\n 'layout_type': {'enum': ['ordered']},\\n 'reflow_type': {'enum': ['auto', 'fixed']},\\n 'show_title': {'type': 'boolean'},\\n 'title': {'type': 'string'},\\n 'title_align': {'enum': ['center', 'left', 'right']},\\n 'type': {'enum': ['group']},\\n 'widgets': {'items': {'additionalProperties': False,\\n 'properties': {'definition': {'additionalProperties': True,\\n 'properties': {'type': {'enum': ['alert_graph',\\n 'alert_value',\\n 'change',\\n 'check_status',\\n 'distribution',\\n 'geomap',\\n 'heatmap',\\n 'hostmap',\\n 'note',\\n 'query_value',\\n 'scatterplot',\\n 'servicemap',\\n 'topology_map',\\n 'query_table',\\n 'timeseries',\\n 'toplist',\\n 'list_stream',\\n 'treemap',\\n 'uptime',\\n 'slo',\\n 'funnel',\\n 'custom',\\n 'experimental',\\n 'sunburst',\\n 'wildcard',\\n 'slo_list',\\n 'flame_graph',\\n 'run_workflow',\\n 'embedded_app',\\n 'log_stream',\\n 'iframe',\\n 'free_text',\\n 'event_stream',\\n 'event_timeline',\\n 'manage_status',\\n 'trace_service',\\n 'image']}},\\n 'required': ['type'],\\n 'type': 'object'},\\n 'id': {'type': 'integer'},\\n 'layout': {'additionalProperties': False,\\n 'properties': {'height': {'type': 'number'},\\n 'is_column_break': {'type': 'boolean'},\\n 'width': {'type': 'number'},\\n 'x': {'type': 'number'},\\n 'y': {'type': 'number'}},\\n 'type': 'object'}},\\n 'required': ['definition'],\\n 'type': 'object'},\\n 'type': 'array'}},\\n 'required': ['type', 'layout_type', 'widgets'],\\n 'type': 'object'}\\n\\nOn instance:\\n {}.\"]}", + "body": "{\"errors\":[\"Invalid group widget for powerpack. Error: 'group1' is not one of ['group']\\n\\nFailed validating 'enum' in schema['properties']['type']:\\n {'enum': ['group']}\\n\\nOn instance['type']:\\n 'group1'.\"]}", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "d5c367a2-9be5-264c-5c0a-feeaf90d0afd" + "id": "ff233efa-3783-ff46-07e4-0cc8d5404793" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/powerpacks/eb0c0428-572b-11ee-92ec-da7ad0900002", + "path": "/api/v2/powerpacks/bc22abe4-6397-11ee-865e-da7ad0900002", "keepAlive": false, "secure": true }, @@ -82,6 +82,6 @@ "timeToLive": { "unlimited": true }, - "id": "0d18f60c-ecbb-d519-a595-254d06881bda" + "id": "d54e920a-29c5-e713-2c88-346ac202d6fa" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/powerpack.feature b/src/test/resources/com/datadog/api/client/v2/api/powerpack.feature index c3a474969ce..e14ebfb6520 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/powerpack.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/powerpack.feature @@ -13,7 +13,7 @@ Feature: Powerpack @team:DataDog/dashboards-backend Scenario: Create a new powerpack returns "Bad Request" response Given new "CreatePowerpack" request - And body with value {"data": {"attributes": {"description": "Powerpack for ABC", "group_widget": {"layout_type": "ordered", "tags": ["tag:foo1"], "type": "group", "widgets": [{"definition": {"content": "example", "type": "note"}}]}, "name": "Sample Powerpack", "tags": ["tag:foo1"], "template_variables": [{"defaults": ["*"], "name": "test"}]}, "type": "powerpack"}} + And body with value {"data": {"attributes": {"description": "Powerpack for ABC", "group_widget": {"definition": {"type": "group1", "layout_type": "ordered", "widgets": []}}, "name": "Sample Powerpack", "tags": ["tag:foo1"], "template_variables": [{"defaults": ["*"], "name": "test"}]}, "type": "powerpack"}} When the request is sent Then the response status is 400 Bad Request @@ -38,13 +38,6 @@ Feature: Powerpack And the response "data.attributes.group_widget.definition.title" is equal to "Sample Powerpack" And the response "data.attributes.group_widget.definition.widgets[0].definition.type" is equal to "note" - @team:DataDog/dashboards-backend - Scenario: Create a new powerpack with missing group_widget returns "Bad Request" response - Given new "CreatePowerpack" request - And body with value {"data":{"type": "powerpack","attributes": {"name": "Sample Powerpack","description": "Sample powerpack","group_widget": {},"template_variables": [{"name": "sample", "defaults": ["*"]}],"tags": ["tag:sample"]}}} - When the request is sent - Then the response status is 400 Bad Request - @team:DataDog/dashboards-backend Scenario: Delete a powerpack returns "OK" response Given there is a valid "powerpack" in the system @@ -93,7 +86,7 @@ Feature: Powerpack @team:DataDog/dashboards-backend Scenario: Get all powerpacks returns "OK" response Given there is a valid "powerpack" in the system - And new "GetAllPowerpacks" request + And new "ListPowerpacks" request When the request is sent Then the response status is 200 OK And the response "data" has item with field "type" with value "powerpack" @@ -117,7 +110,7 @@ Feature: Powerpack Given there is a valid "powerpack" in the system And new "UpdatePowerpack" request And request contains "powerpack_id" parameter from "powerpack.data.id" - And body with value {"data":{"type": "powerpack","attributes": {"name": "Sample Powerpack","description": "Sample powerpack","group_widget": {},"template_variables": [{"name": "sample", "defaults": ["*"]}],"tags": ["tag:sample"]}}} + And body with value {"data":{"type": "powerpack","attributes": {"name": "Sample Powerpack","description": "Sample powerpack","group_widget": {"definition": {"type": "group1", "layout_type": "ordered", "widgets": []}},"template_variables": [{"name": "sample", "defaults": ["*"]}],"tags": ["tag:sample"]}}} When the request is sent Then the response status is 400 Bad Request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 0eacdd54f48..a127541e650 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1023,7 +1023,7 @@ "type": "safe" } }, - "GetAllPowerpacks": { + "ListPowerpacks": { "tag": "Powerpack", "undo": { "type": "safe"