diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index f45d9a1cc95..d02bb7aa5a1 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -15324,6 +15324,41 @@ components:
id:
$ref: "#/components/schemas/ApiID"
type: object
+ CreateOrUpdateWidgetRequest:
+ description: Request body for creating or updating a widget.
+ properties:
+ data:
+ $ref: "#/components/schemas/CreateOrUpdateWidgetRequestData"
+ required:
+ - data
+ type: object
+ CreateOrUpdateWidgetRequestAttributes:
+ description: Attributes for creating or updating a widget.
+ properties:
+ definition:
+ $ref: "#/components/schemas/WidgetDefinition"
+ tags:
+ description: User-defined tags for organizing the widget.
+ items:
+ type: string
+ nullable: true
+ type: array
+ required:
+ - definition
+ type: object
+ CreateOrUpdateWidgetRequestData:
+ description: Data for creating or updating a widget.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/CreateOrUpdateWidgetRequestAttributes"
+ type:
+ description: Widgets resource type.
+ example: widgets
+ type: string
+ required:
+ - type
+ - attributes
+ type: object
CreatePageRequest:
description: Full request to trigger an On-Call Page.
example:
@@ -71675,6 +71710,136 @@ components:
- FRIDAY
- SATURDAY
- SUNDAY
+ WidgetAttributes:
+ description: Attributes of a widget resource.
+ properties:
+ created_at:
+ description: ISO 8601 timestamp of when the widget was created.
+ example: "2024-01-15T00:00:00.000Z"
+ type: string
+ definition:
+ $ref: "#/components/schemas/WidgetDefinition"
+ is_favorited:
+ description: "Will be implemented soon. Currently always returns false."
+ example: false
+ type: boolean
+ modified_at:
+ description: ISO 8601 timestamp of when the widget was last modified.
+ example: "2024-01-15T00:00:00.000Z"
+ type: string
+ tags:
+ description: User-defined tags for organizing widgets.
+ example:
+ - "team:my-team"
+ items:
+ type: string
+ nullable: true
+ type: array
+ required:
+ - definition
+ - tags
+ - is_favorited
+ - created_at
+ - modified_at
+ type: object
+ WidgetData:
+ description: A widget resource object.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/WidgetAttributes"
+ id:
+ description: The unique identifier of the widget.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
+ type: string
+ relationships:
+ $ref: "#/components/schemas/WidgetRelationships"
+ type:
+ description: Widgets resource type.
+ example: widgets
+ type: string
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ WidgetDefinition:
+ additionalProperties: {}
+ description: The definition of a widget, including its type and configuration.
+ properties:
+ title:
+ description: The display title of the widget.
+ example: My Widget
+ maxLength: 100
+ minLength: 1
+ type: string
+ type:
+ $ref: "#/components/schemas/WidgetType"
+ required:
+ - type
+ - title
+ type: object
+ WidgetExperienceType:
+ description: Widget experience types that differentiate between the products using the specific widget.
+ enum:
+ - ccm_reports
+ - logs_reports
+ - csv_reports
+ - product_analytics
+ example: ccm_reports
+ type: string
+ x-enum-varnames:
+ - CCM_REPORTS
+ - LOGS_REPORTS
+ - CSV_REPORTS
+ - PRODUCT_ANALYTICS
+ WidgetIncludedUser:
+ description: A user resource included in the response.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/WidgetIncludedUserAttributes"
+ id:
+ description: The unique identifier of the user.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
+ type: string
+ type:
+ description: Users resource type.
+ example: users
+ type: string
+ required:
+ - id
+ - type
+ type: object
+ WidgetIncludedUserAttributes:
+ description: Attributes of an included user resource.
+ properties:
+ handle:
+ description: The email handle of the user.
+ example: "john.doe@example.com"
+ type: string
+ name:
+ description: The display name of the user.
+ example: "John Doe"
+ nullable: true
+ type: string
+ type: object
+ WidgetListResponse:
+ description: Response containing a list of widgets.
+ properties:
+ data:
+ description: List of widget resources.
+ items:
+ $ref: "#/components/schemas/WidgetData"
+ type: array
+ included:
+ description: Array of user resources related to the widgets.
+ items:
+ $ref: "#/components/schemas/WidgetIncludedUser"
+ type: array
+ meta:
+ $ref: "#/components/schemas/WidgetSearchMeta"
+ required:
+ - data
+ type: object
WidgetLiveSpan:
description: The available timeframes depend on the widget you are using.
enum:
@@ -71711,6 +71876,108 @@ components:
- PAST_SIX_MONTHS
- PAST_ONE_YEAR
- ALERT
+ WidgetRelationshipData:
+ description: Relationship data referencing a user resource.
+ properties:
+ id:
+ description: The unique identifier of the user.
+ example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
+ type: string
+ type:
+ description: Users resource type.
+ example: users
+ type: string
+ required:
+ - id
+ - type
+ type: object
+ WidgetRelationshipItem:
+ description: A JSON:API relationship to a user.
+ properties:
+ data:
+ $ref: "#/components/schemas/WidgetRelationshipData"
+ type: object
+ WidgetRelationships:
+ description: Relationships of the widget resource.
+ properties:
+ created_by:
+ $ref: "#/components/schemas/WidgetRelationshipItem"
+ description: The user who created the widget.
+ modified_by:
+ $ref: "#/components/schemas/WidgetRelationshipItem"
+ description: The user who last modified the widget.
+ type: object
+ WidgetResponse:
+ description: Response containing a single widget.
+ properties:
+ data:
+ $ref: "#/components/schemas/WidgetData"
+ included:
+ description: Array of user resources related to the widget.
+ items:
+ $ref: "#/components/schemas/WidgetIncludedUser"
+ type: array
+ required:
+ - data
+ type: object
+ WidgetSearchMeta:
+ description: Metadata about the search results.
+ properties:
+ created_by_anyone_total:
+ description: Total number of widgets created by anyone.
+ format: int64
+ type: integer
+ created_by_you_total:
+ description: Total number of widgets created by the current user.
+ format: int64
+ type: integer
+ favorited_by_you_total:
+ description: Total number of widgets favorited by the current user.
+ format: int64
+ type: integer
+ filtered_total:
+ description: Total number of widgets matching the current filter criteria.
+ format: int64
+ type: integer
+ type: object
+ WidgetType:
+ description: |-
+ Widget types that are allowed to be stored as individual records.
+ This is not a complete list of dashboard and notebook widget types.
+ enum:
+ - bar_chart
+ - change
+ - cloud_cost_summary
+ - cohort
+ - funnel
+ - geomap
+ - list_stream
+ - query_table
+ - query_value
+ - retention_curve
+ - sankey
+ - sunburst
+ - timeseries
+ - toplist
+ - treemap
+ example: bar_chart
+ type: string
+ x-enum-varnames:
+ - BAR_CHART
+ - CHANGE
+ - CLOUD_COST_SUMMARY
+ - COHORT
+ - FUNNEL
+ - GEOMAP
+ - LIST_STREAM
+ - QUERY_TABLE
+ - QUERY_VALUE
+ - RETENTION_CURVE
+ - SANKEY
+ - SUNBURST
+ - TIMESERIES
+ - TOPLIST
+ - TREEMAP
WorkflowData:
description: Data related to the workflow.
properties:
@@ -109866,6 +110133,328 @@ paths:
operator: OR
permissions:
- teams_read
+ /api/v2/widgets/{experience_type}:
+ get:
+ description: Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination.
+ operationId: SearchWidgets
+ parameters:
+ - description: The experience type for the widget.
+ in: path
+ name: experience_type
+ required: true
+ schema:
+ $ref: "#/components/schemas/WidgetExperienceType"
+ - description: Filter widgets by widget type.
+ in: query
+ name: filter[widgetType]
+ schema:
+ $ref: "#/components/schemas/WidgetType"
+ - description: Filter widgets by the email handle of the creator.
+ in: query
+ name: filter[creatorHandle]
+ schema:
+ example: "john.doe@example.com"
+ type: string
+ - description: Filter to only widgets favorited by the current user.
+ in: query
+ name: filter[isFavorited]
+ schema:
+ type: boolean
+ - description: Filter widgets by title (substring match).
+ in: query
+ name: filter[title]
+ schema:
+ type: string
+ - description: Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`.
+ in: query
+ name: filter[tags]
+ schema:
+ type: string
+ - description: |-
+ Sort field for the results. Prefix with `-` for descending order.
+ Allowed values: `title`, `created_at`, `modified_at`.
+ in: query
+ name: sort
+ schema:
+ default: "-modified_at"
+ example: "-modified_at"
+ type: string
+ - description: Page number for pagination (0-indexed).
+ in: query
+ name: page[number]
+ schema:
+ default: 0
+ minimum: 0
+ type: integer
+ - description: Number of widgets per page.
+ in: query
+ name: page[size]
+ schema:
+ default: 50
+ maximum: 100
+ type: integer
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/WidgetListResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Search widgets
+ tags:
+ - Widgets
+ x-permission:
+ operator: OR
+ permissions:
+ - cloud_cost_management_read
+ - generate_log_reports
+ - manage_log_reports
+ - product_analytics_saved_widgets_read
+ post:
+ description: Create a new widget for a given experience type.
+ operationId: CreateWidget
+ parameters:
+ - description: The experience type for the widget.
+ in: path
+ name: experience_type
+ required: true
+ schema:
+ $ref: "#/components/schemas/WidgetExperienceType"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateOrUpdateWidgetRequest"
+ description: Widget request body.
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/WidgetResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Create a widget
+ tags:
+ - Widgets
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - cloud_cost_management_write
+ - generate_log_reports
+ - manage_log_reports
+ - product_analytics_saved_widgets_write
+ /api/v2/widgets/{experience_type}/{uuid}:
+ delete:
+ description: Soft-delete a widget by its UUID for a given experience type.
+ operationId: DeleteWidget
+ parameters:
+ - description: The experience type for the widget.
+ in: path
+ name: experience_type
+ required: true
+ schema:
+ $ref: "#/components/schemas/WidgetExperienceType"
+ - description: The UUID of the widget.
+ in: path
+ name: uuid
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ "204":
+ description: No Content
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Delete a widget
+ tags:
+ - Widgets
+ x-permission:
+ operator: OR
+ permissions:
+ - cloud_cost_management_write
+ - generate_log_reports
+ - manage_log_reports
+ - product_analytics_saved_widgets_write
+ get:
+ description: Retrieve a widget by its UUID for a given experience type.
+ operationId: GetWidget
+ parameters:
+ - description: The experience type for the widget.
+ in: path
+ name: experience_type
+ required: true
+ schema:
+ $ref: "#/components/schemas/WidgetExperienceType"
+ - description: The UUID of the widget.
+ in: path
+ name: uuid
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/WidgetResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Get a widget
+ tags:
+ - Widgets
+ x-permission:
+ operator: OR
+ permissions:
+ - cloud_cost_management_read
+ - generate_log_reports
+ - manage_log_reports
+ - product_analytics_saved_widgets_read
+ put:
+ description: Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition.
+ operationId: UpdateWidget
+ parameters:
+ - description: The experience type for the widget.
+ in: path
+ name: experience_type
+ required: true
+ schema:
+ $ref: "#/components/schemas/WidgetExperienceType"
+ - description: The UUID of the widget.
+ in: path
+ name: uuid
+ required: true
+ schema:
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CreateOrUpdateWidgetRequest"
+ description: Widget request body.
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/WidgetResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/APIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ summary: Update a widget
+ tags:
+ - Widgets
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - cloud_cost_management_write
+ - generate_log_reports
+ - manage_log_reports
+ - product_analytics_saved_widgets_write
/api/v2/workflows:
post:
description: Create a new workflow, returning the workflow ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).
@@ -110716,6 +111305,11 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/account_management/users
name: Users
+ - description: |-
+ Create, read, update, and delete saved widgets. Widgets are reusable
+ visualization components stored independently from any dashboard or notebook,
+ partitioned by experience type and identified by a UUID.
+ name: Widgets
- description: |-
Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions, including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow Automation docs [here](https://docs.datadoghq.com/service_management/workflows/).
externalDocs:
diff --git a/examples/v2/widgets/CreateWidget.java b/examples/v2/widgets/CreateWidget.java
new file mode 100644
index 00000000000..fcda8927285
--- /dev/null
+++ b/examples/v2/widgets/CreateWidget.java
@@ -0,0 +1,42 @@
+// Create a widget returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.WidgetsApi;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequest;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestAttributes;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestData;
+import com.datadog.api.client.v2.model.WidgetDefinition;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import com.datadog.api.client.v2.model.WidgetResponse;
+import com.datadog.api.client.v2.model.WidgetType;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ WidgetsApi apiInstance = new WidgetsApi(defaultClient);
+
+ CreateOrUpdateWidgetRequest body =
+ new CreateOrUpdateWidgetRequest()
+ .data(
+ new CreateOrUpdateWidgetRequestData()
+ .attributes(
+ new CreateOrUpdateWidgetRequestAttributes()
+ .definition(
+ new WidgetDefinition()
+ .title("My Widget")
+ .type(WidgetType.BAR_CHART)))
+ .type("widgets"));
+
+ try {
+ WidgetResponse result = apiInstance.createWidget(WidgetExperienceType.CCM_REPORTS, body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WidgetsApi#createWidget");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/widgets/DeleteWidget.java b/examples/v2/widgets/DeleteWidget.java
new file mode 100644
index 00000000000..cf76c095eec
--- /dev/null
+++ b/examples/v2/widgets/DeleteWidget.java
@@ -0,0 +1,26 @@
+// Delete a widget returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.WidgetsApi;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ WidgetsApi apiInstance = new WidgetsApi(defaultClient);
+
+ try {
+ apiInstance.deleteWidget(
+ WidgetExperienceType.CCM_REPORTS,
+ UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WidgetsApi#deleteWidget");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/widgets/GetWidget.java b/examples/v2/widgets/GetWidget.java
new file mode 100644
index 00000000000..ded31dfd389
--- /dev/null
+++ b/examples/v2/widgets/GetWidget.java
@@ -0,0 +1,29 @@
+// Get a widget returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.WidgetsApi;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import com.datadog.api.client.v2.model.WidgetResponse;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ WidgetsApi apiInstance = new WidgetsApi(defaultClient);
+
+ try {
+ WidgetResponse result =
+ apiInstance.getWidget(
+ WidgetExperienceType.CCM_REPORTS,
+ UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WidgetsApi#getWidget");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/widgets/SearchWidgets.java b/examples/v2/widgets/SearchWidgets.java
new file mode 100644
index 00000000000..9d0020e199d
--- /dev/null
+++ b/examples/v2/widgets/SearchWidgets.java
@@ -0,0 +1,25 @@
+// Search widgets returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.WidgetsApi;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import com.datadog.api.client.v2.model.WidgetListResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ WidgetsApi apiInstance = new WidgetsApi(defaultClient);
+
+ try {
+ WidgetListResponse result = apiInstance.searchWidgets(WidgetExperienceType.CCM_REPORTS);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WidgetsApi#searchWidgets");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/widgets/UpdateWidget.java b/examples/v2/widgets/UpdateWidget.java
new file mode 100644
index 00000000000..d9c7a92ecc9
--- /dev/null
+++ b/examples/v2/widgets/UpdateWidget.java
@@ -0,0 +1,47 @@
+// Update a widget returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.WidgetsApi;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequest;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestAttributes;
+import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestData;
+import com.datadog.api.client.v2.model.WidgetDefinition;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import com.datadog.api.client.v2.model.WidgetResponse;
+import com.datadog.api.client.v2.model.WidgetType;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ WidgetsApi apiInstance = new WidgetsApi(defaultClient);
+
+ CreateOrUpdateWidgetRequest body =
+ new CreateOrUpdateWidgetRequest()
+ .data(
+ new CreateOrUpdateWidgetRequestData()
+ .attributes(
+ new CreateOrUpdateWidgetRequestAttributes()
+ .definition(
+ new WidgetDefinition()
+ .title("My Widget")
+ .type(WidgetType.BAR_CHART)))
+ .type("widgets"));
+
+ try {
+ WidgetResponse result =
+ apiInstance.updateWidget(
+ WidgetExperienceType.CCM_REPORTS,
+ UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
+ body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling WidgetsApi#updateWidget");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java b/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java
new file mode 100644
index 00000000000..dc28ab77bf1
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java
@@ -0,0 +1,1037 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+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.CreateOrUpdateWidgetRequest;
+import com.datadog.api.client.v2.model.WidgetExperienceType;
+import com.datadog.api.client.v2.model.WidgetListResponse;
+import com.datadog.api.client.v2.model.WidgetResponse;
+import com.datadog.api.client.v2.model.WidgetType;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetsApi {
+ private ApiClient apiClient;
+
+ public WidgetsApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public WidgetsApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Create a widget.
+ *
+ *
See {@link #createWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param body Widget request body. (required)
+ * @return WidgetResponse
+ * @throws ApiException if fails to make API call
+ */
+ public WidgetResponse createWidget(
+ WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) throws ApiException {
+ return createWidgetWithHttpInfo(experienceType, body).getData();
+ }
+
+ /**
+ * Create a widget.
+ *
+ *
See {@link #createWidgetWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param body Widget request body. (required)
+ * @return CompletableFuture<WidgetResponse>
+ */
+ public CompletableFuture createWidgetAsync(
+ WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) {
+ return createWidgetWithHttpInfoAsync(experienceType, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a new widget for a given experience type.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param body Widget request body. (required)
+ * @return ApiResponse<WidgetResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createWidgetWithHttpInfo(
+ WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling createWidget");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createWidget");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.createWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create a widget.
+ *
+ * See {@link #createWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param body Widget request body. (required)
+ * @return CompletableFuture<ApiResponse<WidgetResponse>>
+ */
+ public CompletableFuture> createWidgetWithHttpInfoAsync(
+ WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling createWidget"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(400, "Missing the required parameter 'body' when calling createWidget"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.createWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Delete a widget.
+ *
+ * See {@link #deleteWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteWidget(WidgetExperienceType experienceType, UUID uuid) throws ApiException {
+ deleteWidgetWithHttpInfo(experienceType, uuid);
+ }
+
+ /**
+ * Delete a widget.
+ *
+ *
See {@link #deleteWidgetWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteWidgetAsync(WidgetExperienceType experienceType, UUID uuid) {
+ return deleteWidgetWithHttpInfoAsync(experienceType, uuid)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Soft-delete a widget by its UUID for a given experience type.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | No Content | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteWidgetWithHttpInfo(WidgetExperienceType experienceType, UUID uuid)
+ throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling deleteWidget");
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'uuid' when calling deleteWidget");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.deleteWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete a widget.
+ *
+ * See {@link #deleteWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteWidgetWithHttpInfoAsync(
+ WidgetExperienceType experienceType, UUID uuid) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling deleteWidget"));
+ return result;
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(400, "Missing the required parameter 'uuid' when calling deleteWidget"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.deleteWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Get a widget.
+ *
+ * See {@link #getWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return WidgetResponse
+ * @throws ApiException if fails to make API call
+ */
+ public WidgetResponse getWidget(WidgetExperienceType experienceType, UUID uuid)
+ throws ApiException {
+ return getWidgetWithHttpInfo(experienceType, uuid).getData();
+ }
+
+ /**
+ * Get a widget.
+ *
+ *
See {@link #getWidgetWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return CompletableFuture<WidgetResponse>
+ */
+ public CompletableFuture getWidgetAsync(
+ WidgetExperienceType experienceType, UUID uuid) {
+ return getWidgetWithHttpInfoAsync(experienceType, uuid)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve a widget by its UUID for a given experience type.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return ApiResponse<WidgetResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse getWidgetWithHttpInfo(
+ WidgetExperienceType experienceType, UUID uuid) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling getWidget");
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ throw new ApiException(400, "Missing the required parameter 'uuid' when calling getWidget");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.getWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a widget.
+ *
+ * See {@link #getWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @return CompletableFuture<ApiResponse<WidgetResponse>>
+ */
+ public CompletableFuture> getWidgetWithHttpInfoAsync(
+ WidgetExperienceType experienceType, UUID uuid) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling getWidget"));
+ return result;
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(400, "Missing the required parameter 'uuid' when calling getWidget"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.getWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to searchWidgets. */
+ public static class SearchWidgetsOptionalParameters {
+ private WidgetType filterWidgetType;
+ private String filterCreatorHandle;
+ private Boolean filterIsFavorited;
+ private String filterTitle;
+ private String filterTags;
+ private String sort;
+ private Integer pageNumber;
+ private Integer pageSize;
+
+ /**
+ * Set filterWidgetType.
+ *
+ * @param filterWidgetType Filter widgets by widget type. (optional)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters filterWidgetType(WidgetType filterWidgetType) {
+ this.filterWidgetType = filterWidgetType;
+ return this;
+ }
+
+ /**
+ * Set filterCreatorHandle.
+ *
+ * @param filterCreatorHandle Filter widgets by the email handle of the creator. (optional)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters filterCreatorHandle(String filterCreatorHandle) {
+ this.filterCreatorHandle = filterCreatorHandle;
+ return this;
+ }
+
+ /**
+ * Set filterIsFavorited.
+ *
+ * @param filterIsFavorited Filter to only widgets favorited by the current user. (optional)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters filterIsFavorited(Boolean filterIsFavorited) {
+ this.filterIsFavorited = filterIsFavorited;
+ return this;
+ }
+
+ /**
+ * Set filterTitle.
+ *
+ * @param filterTitle Filter widgets by title (substring match). (optional)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters filterTitle(String filterTitle) {
+ this.filterTitle = filterTitle;
+ return this;
+ }
+
+ /**
+ * Set filterTags.
+ *
+ * @param filterTags Filter widgets by tags. Format as bracket-delimited CSV, e.g.
+ * [tag1,tag2]. (optional)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters filterTags(String filterTags) {
+ this.filterTags = filterTags;
+ return this;
+ }
+
+ /**
+ * Set sort.
+ *
+ * @param sort Sort field for the results. Prefix with - for descending order.
+ * Allowed values: title, created_at, modified_at.
+ * (optional, default to "-modified_at")
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters sort(String sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ /**
+ * Set pageNumber.
+ *
+ * @param pageNumber Page number for pagination (0-indexed). (optional, default to 0)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters pageNumber(Integer pageNumber) {
+ this.pageNumber = pageNumber;
+ return this;
+ }
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize Number of widgets per page. (optional, default to 50)
+ * @return SearchWidgetsOptionalParameters
+ */
+ public SearchWidgetsOptionalParameters pageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+ }
+
+ /**
+ * Search widgets.
+ *
+ * See {@link #searchWidgetsWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @return WidgetListResponse
+ * @throws ApiException if fails to make API call
+ */
+ public WidgetListResponse searchWidgets(WidgetExperienceType experienceType) throws ApiException {
+ return searchWidgetsWithHttpInfo(experienceType, new SearchWidgetsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Search widgets.
+ *
+ *
See {@link #searchWidgetsWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @return CompletableFuture<WidgetListResponse>
+ */
+ public CompletableFuture searchWidgetsAsync(
+ WidgetExperienceType experienceType) {
+ return searchWidgetsWithHttpInfoAsync(experienceType, new SearchWidgetsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Search widgets.
+ *
+ * See {@link #searchWidgetsWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param parameters Optional parameters for the request.
+ * @return WidgetListResponse
+ * @throws ApiException if fails to make API call
+ */
+ public WidgetListResponse searchWidgets(
+ WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters)
+ throws ApiException {
+ return searchWidgetsWithHttpInfo(experienceType, parameters).getData();
+ }
+
+ /**
+ * Search widgets.
+ *
+ *
See {@link #searchWidgetsWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<WidgetListResponse>
+ */
+ public CompletableFuture searchWidgetsAsync(
+ WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) {
+ return searchWidgetsWithHttpInfoAsync(experienceType, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Search and list widgets for a given experience type. Supports filtering by widget type,
+ * creator, title, and tags, as well as sorting and pagination.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<WidgetListResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse searchWidgetsWithHttpInfo(
+ WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters)
+ throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling searchWidgets");
+ }
+ WidgetType filterWidgetType = parameters.filterWidgetType;
+ String filterCreatorHandle = parameters.filterCreatorHandle;
+ Boolean filterIsFavorited = parameters.filterIsFavorited;
+ String filterTitle = parameters.filterTitle;
+ String filterTags = parameters.filterTags;
+ String sort = parameters.sort;
+ Integer pageNumber = parameters.pageNumber;
+ Integer pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[widgetType]", filterWidgetType));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[creatorHandle]", filterCreatorHandle));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[isFavorited]", filterIsFavorited));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.searchWidgets",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Search widgets.
+ *
+ * See {@link #searchWidgetsWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<WidgetListResponse>>
+ */
+ public CompletableFuture> searchWidgetsWithHttpInfoAsync(
+ WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling searchWidgets"));
+ return result;
+ }
+ WidgetType filterWidgetType = parameters.filterWidgetType;
+ String filterCreatorHandle = parameters.filterCreatorHandle;
+ Boolean filterIsFavorited = parameters.filterIsFavorited;
+ String filterTitle = parameters.filterTitle;
+ String filterTags = parameters.filterTags;
+ String sort = parameters.sort;
+ Integer pageNumber = parameters.pageNumber;
+ Integer pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[widgetType]", filterWidgetType));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[creatorHandle]", filterCreatorHandle));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[isFavorited]", filterIsFavorited));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.searchWidgets",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update a widget.
+ *
+ * See {@link #updateWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @param body Widget request body. (required)
+ * @return WidgetResponse
+ * @throws ApiException if fails to make API call
+ */
+ public WidgetResponse updateWidget(
+ WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body)
+ throws ApiException {
+ return updateWidgetWithHttpInfo(experienceType, uuid, body).getData();
+ }
+
+ /**
+ * Update a widget.
+ *
+ *
See {@link #updateWidgetWithHttpInfoAsync}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @param body Widget request body. (required)
+ * @return CompletableFuture<WidgetResponse>
+ */
+ public CompletableFuture updateWidgetAsync(
+ WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) {
+ return updateWidgetWithHttpInfoAsync(experienceType, uuid, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update a widget by its UUID for a given experience type. This performs a full replacement of
+ * the widget definition.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @param body Widget request body. (required)
+ * @return ApiResponse<WidgetResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse updateWidgetWithHttpInfo(
+ WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body)
+ throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling updateWidget");
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'uuid' when calling updateWidget");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateWidget");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.updateWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update a widget.
+ *
+ * See {@link #updateWidgetWithHttpInfo}.
+ *
+ * @param experienceType The experience type for the widget. (required)
+ * @param uuid The UUID of the widget. (required)
+ * @param body Widget request body. (required)
+ * @return CompletableFuture<ApiResponse<WidgetResponse>>
+ */
+ public CompletableFuture> updateWidgetWithHttpInfoAsync(
+ WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'experienceType' is set
+ if (experienceType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'experienceType' when calling updateWidget"));
+ return result;
+ }
+
+ // verify the required parameter 'uuid' is set
+ if (uuid == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(400, "Missing the required parameter 'uuid' when calling updateWidget"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(400, "Missing the required parameter 'body' when calling updateWidget"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/widgets/{experience_type}/{uuid}"
+ .replaceAll(
+ "\\{" + "experience_type" + "\\}",
+ apiClient.escapeString(experienceType.toString()))
+ .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.WidgetsApi.updateWidget",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java
new file mode 100644
index 00000000000..1f1601d3a4b
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java
@@ -0,0 +1,147 @@
+/*
+ * 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;
+
+/** Request body for creating or updating a widget. */
+@JsonPropertyOrder({CreateOrUpdateWidgetRequest.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateOrUpdateWidgetRequest {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private CreateOrUpdateWidgetRequestData data;
+
+ public CreateOrUpdateWidgetRequest() {}
+
+ @JsonCreator
+ public CreateOrUpdateWidgetRequest(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA)
+ CreateOrUpdateWidgetRequestData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public CreateOrUpdateWidgetRequest data(CreateOrUpdateWidgetRequestData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Data for creating or updating a widget.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CreateOrUpdateWidgetRequestData getData() {
+ return data;
+ }
+
+ public void setData(CreateOrUpdateWidgetRequestData data) {
+ this.data = data;
+ }
+
+ /**
+ * 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 CreateOrUpdateWidgetRequest
+ */
+ @JsonAnySetter
+ public CreateOrUpdateWidgetRequest 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 CreateOrUpdateWidgetRequest object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateOrUpdateWidgetRequest createOrUpdateWidgetRequest = (CreateOrUpdateWidgetRequest) o;
+ return Objects.equals(this.data, createOrUpdateWidgetRequest.data)
+ && Objects.equals(
+ this.additionalProperties, createOrUpdateWidgetRequest.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateOrUpdateWidgetRequest {\n");
+ sb.append(" data: ").append(toIndentedString(data)).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/CreateOrUpdateWidgetRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestAttributes.java
new file mode 100644
index 00000000000..3b8616026be
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestAttributes.java
@@ -0,0 +1,202 @@
+/*
+ * 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;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+/** Attributes for creating or updating a widget. */
+@JsonPropertyOrder({
+ CreateOrUpdateWidgetRequestAttributes.JSON_PROPERTY_DEFINITION,
+ CreateOrUpdateWidgetRequestAttributes.JSON_PROPERTY_TAGS
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateOrUpdateWidgetRequestAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DEFINITION = "definition";
+ private WidgetDefinition definition;
+
+ public static final String JSON_PROPERTY_TAGS = "tags";
+ private JsonNullable> tags = JsonNullable.>undefined();
+
+ public CreateOrUpdateWidgetRequestAttributes() {}
+
+ @JsonCreator
+ public CreateOrUpdateWidgetRequestAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION)
+ WidgetDefinition definition) {
+ this.definition = definition;
+ this.unparsed |= definition.unparsed;
+ }
+
+ public CreateOrUpdateWidgetRequestAttributes definition(WidgetDefinition definition) {
+ this.definition = definition;
+ this.unparsed |= definition.unparsed;
+ return this;
+ }
+
+ /**
+ * The definition of a widget, including its type and configuration.
+ *
+ * @return definition
+ */
+ @JsonProperty(JSON_PROPERTY_DEFINITION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public WidgetDefinition getDefinition() {
+ return definition;
+ }
+
+ public void setDefinition(WidgetDefinition definition) {
+ this.definition = definition;
+ }
+
+ public CreateOrUpdateWidgetRequestAttributes tags(List tags) {
+ this.tags = JsonNullable.>of(tags);
+ return this;
+ }
+
+ public CreateOrUpdateWidgetRequestAttributes addTagsItem(String tagsItem) {
+ if (this.tags == null || !this.tags.isPresent()) {
+ this.tags = JsonNullable.>of(new ArrayList<>());
+ }
+ try {
+ this.tags.get().add(tagsItem);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ }
+
+ /**
+ * User-defined tags for organizing the widget.
+ *
+ * @return tags
+ */
+ @jakarta.annotation.Nullable
+ @JsonIgnore
+ public List getTags() {
+ return tags.orElse(null);
+ }
+
+ @JsonProperty(JSON_PROPERTY_TAGS)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public JsonNullable> getTags_JsonNullable() {
+ return tags;
+ }
+
+ @JsonProperty(JSON_PROPERTY_TAGS)
+ public void setTags_JsonNullable(JsonNullable> tags) {
+ this.tags = tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = JsonNullable.>of(tags);
+ }
+
+ /**
+ * 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 CreateOrUpdateWidgetRequestAttributes
+ */
+ @JsonAnySetter
+ public CreateOrUpdateWidgetRequestAttributes 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 CreateOrUpdateWidgetRequestAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateOrUpdateWidgetRequestAttributes createOrUpdateWidgetRequestAttributes =
+ (CreateOrUpdateWidgetRequestAttributes) o;
+ return Objects.equals(this.definition, createOrUpdateWidgetRequestAttributes.definition)
+ && Objects.equals(this.tags, createOrUpdateWidgetRequestAttributes.tags)
+ && Objects.equals(
+ this.additionalProperties, createOrUpdateWidgetRequestAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(definition, tags, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateOrUpdateWidgetRequestAttributes {\n");
+ sb.append(" definition: ").append(toIndentedString(definition)).append("\n");
+ sb.append(" tags: ").append(toIndentedString(tags)).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/CreateOrUpdateWidgetRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestData.java
new file mode 100644
index 00000000000..85604bace65
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestData.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;
+
+/** Data for creating or updating a widget. */
+@JsonPropertyOrder({
+ CreateOrUpdateWidgetRequestData.JSON_PROPERTY_ATTRIBUTES,
+ CreateOrUpdateWidgetRequestData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CreateOrUpdateWidgetRequestData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private CreateOrUpdateWidgetRequestAttributes attributes;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public CreateOrUpdateWidgetRequestData() {}
+
+ @JsonCreator
+ public CreateOrUpdateWidgetRequestData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ CreateOrUpdateWidgetRequestAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.type = type;
+ }
+
+ public CreateOrUpdateWidgetRequestData attributes(
+ CreateOrUpdateWidgetRequestAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Attributes for creating or updating a widget.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CreateOrUpdateWidgetRequestAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(CreateOrUpdateWidgetRequestAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public CreateOrUpdateWidgetRequestData type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Widgets resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * 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 CreateOrUpdateWidgetRequestData
+ */
+ @JsonAnySetter
+ public CreateOrUpdateWidgetRequestData 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 CreateOrUpdateWidgetRequestData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateOrUpdateWidgetRequestData createOrUpdateWidgetRequestData =
+ (CreateOrUpdateWidgetRequestData) o;
+ return Objects.equals(this.attributes, createOrUpdateWidgetRequestData.attributes)
+ && Objects.equals(this.type, createOrUpdateWidgetRequestData.type)
+ && Objects.equals(
+ this.additionalProperties, createOrUpdateWidgetRequestData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateOrUpdateWidgetRequestData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).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/WidgetAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WidgetAttributes.java
new file mode 100644
index 00000000000..b7f0c9cbf2e
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetAttributes.java
@@ -0,0 +1,268 @@
+/*
+ * 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;
+
+/** Attributes of a widget resource. */
+@JsonPropertyOrder({
+ WidgetAttributes.JSON_PROPERTY_CREATED_AT,
+ WidgetAttributes.JSON_PROPERTY_DEFINITION,
+ WidgetAttributes.JSON_PROPERTY_IS_FAVORITED,
+ WidgetAttributes.JSON_PROPERTY_MODIFIED_AT,
+ WidgetAttributes.JSON_PROPERTY_TAGS
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CREATED_AT = "created_at";
+ private String createdAt;
+
+ public static final String JSON_PROPERTY_DEFINITION = "definition";
+ private WidgetDefinition definition;
+
+ public static final String JSON_PROPERTY_IS_FAVORITED = "is_favorited";
+ private Boolean isFavorited;
+
+ public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at";
+ private String modifiedAt;
+
+ public static final String JSON_PROPERTY_TAGS = "tags";
+ private List tags = new ArrayList<>();
+
+ public WidgetAttributes() {}
+
+ @JsonCreator
+ public WidgetAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) String createdAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) WidgetDefinition definition,
+ @JsonProperty(required = true, value = JSON_PROPERTY_IS_FAVORITED) Boolean isFavorited,
+ @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) String modifiedAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) {
+ this.createdAt = createdAt;
+ this.definition = definition;
+ this.unparsed |= definition.unparsed;
+ this.isFavorited = isFavorited;
+ this.modifiedAt = modifiedAt;
+ this.tags = tags;
+ if (tags != null) {}
+ }
+
+ public WidgetAttributes createdAt(String createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * ISO 8601 timestamp of when the widget was created.
+ *
+ * @return createdAt
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(String createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public WidgetAttributes definition(WidgetDefinition definition) {
+ this.definition = definition;
+ this.unparsed |= definition.unparsed;
+ return this;
+ }
+
+ /**
+ * The definition of a widget, including its type and configuration.
+ *
+ * @return definition
+ */
+ @JsonProperty(JSON_PROPERTY_DEFINITION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public WidgetDefinition getDefinition() {
+ return definition;
+ }
+
+ public void setDefinition(WidgetDefinition definition) {
+ this.definition = definition;
+ }
+
+ public WidgetAttributes isFavorited(Boolean isFavorited) {
+ this.isFavorited = isFavorited;
+ return this;
+ }
+
+ /**
+ * Will be implemented soon. Currently always returns false.
+ *
+ * @return isFavorited
+ */
+ @JsonProperty(JSON_PROPERTY_IS_FAVORITED)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Boolean getIsFavorited() {
+ return isFavorited;
+ }
+
+ public void setIsFavorited(Boolean isFavorited) {
+ this.isFavorited = isFavorited;
+ }
+
+ public WidgetAttributes modifiedAt(String modifiedAt) {
+ this.modifiedAt = modifiedAt;
+ return this;
+ }
+
+ /**
+ * ISO 8601 timestamp of when the widget was last modified.
+ *
+ * @return modifiedAt
+ */
+ @JsonProperty(JSON_PROPERTY_MODIFIED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getModifiedAt() {
+ return modifiedAt;
+ }
+
+ public void setModifiedAt(String modifiedAt) {
+ this.modifiedAt = modifiedAt;
+ }
+
+ public WidgetAttributes tags(List tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ public WidgetAttributes addTagsItem(String tagsItem) {
+ this.tags.add(tagsItem);
+ return this;
+ }
+
+ /**
+ * User-defined tags for organizing widgets.
+ *
+ * @return tags
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_TAGS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+ /**
+ * 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 WidgetAttributes
+ */
+ @JsonAnySetter
+ public WidgetAttributes 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 WidgetAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetAttributes widgetAttributes = (WidgetAttributes) o;
+ return Objects.equals(this.createdAt, widgetAttributes.createdAt)
+ && Objects.equals(this.definition, widgetAttributes.definition)
+ && Objects.equals(this.isFavorited, widgetAttributes.isFavorited)
+ && Objects.equals(this.modifiedAt, widgetAttributes.modifiedAt)
+ && Objects.equals(this.tags, widgetAttributes.tags)
+ && Objects.equals(this.additionalProperties, widgetAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(createdAt, definition, isFavorited, modifiedAt, tags, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetAttributes {\n");
+ sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
+ sb.append(" definition: ").append(toIndentedString(definition)).append("\n");
+ sb.append(" isFavorited: ").append(toIndentedString(isFavorited)).append("\n");
+ sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n");
+ sb.append(" tags: ").append(toIndentedString(tags)).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/WidgetData.java b/src/main/java/com/datadog/api/client/v2/model/WidgetData.java
new file mode 100644
index 00000000000..35056cec50e
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetData.java
@@ -0,0 +1,231 @@
+/*
+ * 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;
+
+/** A widget resource object. */
+@JsonPropertyOrder({
+ WidgetData.JSON_PROPERTY_ATTRIBUTES,
+ WidgetData.JSON_PROPERTY_ID,
+ WidgetData.JSON_PROPERTY_RELATIONSHIPS,
+ WidgetData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private WidgetAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships";
+ private WidgetRelationships relationships;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public WidgetData() {}
+
+ @JsonCreator
+ public WidgetData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) WidgetAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ }
+
+ public WidgetData attributes(WidgetAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Attributes of a widget resource.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public WidgetAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(WidgetAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public WidgetData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The unique identifier of the widget.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public WidgetData relationships(WidgetRelationships relationships) {
+ this.relationships = relationships;
+ this.unparsed |= relationships.unparsed;
+ return this;
+ }
+
+ /**
+ * Relationships of the widget resource.
+ *
+ * @return relationships
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_RELATIONSHIPS)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetRelationships getRelationships() {
+ return relationships;
+ }
+
+ public void setRelationships(WidgetRelationships relationships) {
+ this.relationships = relationships;
+ }
+
+ public WidgetData type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Widgets resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * 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 WidgetData
+ */
+ @JsonAnySetter
+ public WidgetData 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 WidgetData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetData widgetData = (WidgetData) o;
+ return Objects.equals(this.attributes, widgetData.attributes)
+ && Objects.equals(this.id, widgetData.id)
+ && Objects.equals(this.relationships, widgetData.relationships)
+ && Objects.equals(this.type, widgetData.type)
+ && Objects.equals(this.additionalProperties, widgetData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, relationships, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).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/WidgetDefinition.java b/src/main/java/com/datadog/api/client/v2/model/WidgetDefinition.java
new file mode 100644
index 00000000000..0fb3d1812c2
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetDefinition.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;
+
+/** The definition of a widget, including its type and configuration. */
+@JsonPropertyOrder({WidgetDefinition.JSON_PROPERTY_TITLE, WidgetDefinition.JSON_PROPERTY_TYPE})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetDefinition {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_TITLE = "title";
+ private String title;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private WidgetType type;
+
+ public WidgetDefinition() {}
+
+ @JsonCreator
+ public WidgetDefinition(
+ @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) WidgetType type) {
+ this.title = title;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public WidgetDefinition title(String title) {
+ this.title = title;
+ return this;
+ }
+
+ /**
+ * The display title of the widget.
+ *
+ * @return title
+ */
+ @JsonProperty(JSON_PROPERTY_TITLE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public WidgetDefinition type(WidgetType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Widget types that are allowed to be stored as individual records. This is not a complete list
+ * of dashboard and notebook widget types.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public WidgetType getType() {
+ return type;
+ }
+
+ public void setType(WidgetType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * 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 WidgetDefinition
+ */
+ @JsonAnySetter
+ public WidgetDefinition 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 WidgetDefinition object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetDefinition widgetDefinition = (WidgetDefinition) o;
+ return Objects.equals(this.title, widgetDefinition.title)
+ && Objects.equals(this.type, widgetDefinition.type)
+ && Objects.equals(this.additionalProperties, widgetDefinition.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(title, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetDefinition {\n");
+ sb.append(" title: ").append(toIndentedString(title)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).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/WidgetExperienceType.java b/src/main/java/com/datadog/api/client/v2/model/WidgetExperienceType.java
new file mode 100644
index 00000000000..5b1bd842156
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetExperienceType.java
@@ -0,0 +1,60 @@
+/*
+ * 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.datadog.api.client.ModelEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/** Widget experience types that differentiate between the products using the specific widget. */
+@JsonSerialize(using = WidgetExperienceType.WidgetExperienceTypeSerializer.class)
+public class WidgetExperienceType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(
+ Arrays.asList("ccm_reports", "logs_reports", "csv_reports", "product_analytics"));
+
+ public static final WidgetExperienceType CCM_REPORTS = new WidgetExperienceType("ccm_reports");
+ public static final WidgetExperienceType LOGS_REPORTS = new WidgetExperienceType("logs_reports");
+ public static final WidgetExperienceType CSV_REPORTS = new WidgetExperienceType("csv_reports");
+ public static final WidgetExperienceType PRODUCT_ANALYTICS =
+ new WidgetExperienceType("product_analytics");
+
+ WidgetExperienceType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class WidgetExperienceTypeSerializer extends StdSerializer {
+ public WidgetExperienceTypeSerializer(Class t) {
+ super(t);
+ }
+
+ public WidgetExperienceTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ WidgetExperienceType value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static WidgetExperienceType fromValue(String value) {
+ return new WidgetExperienceType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java
new file mode 100644
index 00000000000..6b2b2c57245
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java
@@ -0,0 +1,201 @@
+/*
+ * 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;
+
+/** A user resource included in the response. */
+@JsonPropertyOrder({
+ WidgetIncludedUser.JSON_PROPERTY_ATTRIBUTES,
+ WidgetIncludedUser.JSON_PROPERTY_ID,
+ WidgetIncludedUser.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetIncludedUser {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private WidgetIncludedUserAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public WidgetIncludedUser() {}
+
+ @JsonCreator
+ public WidgetIncludedUser(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) {
+ this.id = id;
+ this.type = type;
+ }
+
+ public WidgetIncludedUser attributes(WidgetIncludedUserAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Attributes of an included user resource.
+ *
+ * @return attributes
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetIncludedUserAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(WidgetIncludedUserAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public WidgetIncludedUser id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The unique identifier of the user.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public WidgetIncludedUser type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Users resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * 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 WidgetIncludedUser
+ */
+ @JsonAnySetter
+ public WidgetIncludedUser 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 WidgetIncludedUser object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetIncludedUser widgetIncludedUser = (WidgetIncludedUser) o;
+ return Objects.equals(this.attributes, widgetIncludedUser.attributes)
+ && Objects.equals(this.id, widgetIncludedUser.id)
+ && Objects.equals(this.type, widgetIncludedUser.type)
+ && Objects.equals(this.additionalProperties, widgetIncludedUser.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetIncludedUser {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).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/WidgetIncludedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUserAttributes.java
new file mode 100644
index 00000000000..93e2e67aa27
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUserAttributes.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.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;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+/** Attributes of an included user resource. */
+@JsonPropertyOrder({
+ WidgetIncludedUserAttributes.JSON_PROPERTY_HANDLE,
+ WidgetIncludedUserAttributes.JSON_PROPERTY_NAME
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetIncludedUserAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_HANDLE = "handle";
+ private String handle;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ private JsonNullable name = JsonNullable.undefined();
+
+ public WidgetIncludedUserAttributes handle(String handle) {
+ this.handle = handle;
+ return this;
+ }
+
+ /**
+ * The email handle of the user.
+ *
+ * @return handle
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_HANDLE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getHandle() {
+ return handle;
+ }
+
+ public void setHandle(String handle) {
+ this.handle = handle;
+ }
+
+ public WidgetIncludedUserAttributes name(String name) {
+ this.name = JsonNullable.of(name);
+ return this;
+ }
+
+ /**
+ * The display name of the user.
+ *
+ * @return name
+ */
+ @jakarta.annotation.Nullable
+ @JsonIgnore
+ public String getName() {
+ return name.orElse(null);
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public JsonNullable getName_JsonNullable() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ public void setName_JsonNullable(JsonNullable name) {
+ this.name = name;
+ }
+
+ public void setName(String name) {
+ this.name = JsonNullable.of(name);
+ }
+
+ /**
+ * 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 WidgetIncludedUserAttributes
+ */
+ @JsonAnySetter
+ public WidgetIncludedUserAttributes 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 WidgetIncludedUserAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetIncludedUserAttributes widgetIncludedUserAttributes = (WidgetIncludedUserAttributes) o;
+ return Objects.equals(this.handle, widgetIncludedUserAttributes.handle)
+ && Objects.equals(this.name, widgetIncludedUserAttributes.name)
+ && Objects.equals(
+ this.additionalProperties, widgetIncludedUserAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(handle, name, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetIncludedUserAttributes {\n");
+ sb.append(" handle: ").append(toIndentedString(handle)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).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/WidgetListResponse.java b/src/main/java/com/datadog/api/client/v2/model/WidgetListResponse.java
new file mode 100644
index 00000000000..158ec1988ad
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetListResponse.java
@@ -0,0 +1,223 @@
+/*
+ * 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;
+
+/** Response containing a list of widgets. */
+@JsonPropertyOrder({
+ WidgetListResponse.JSON_PROPERTY_DATA,
+ WidgetListResponse.JSON_PROPERTY_INCLUDED,
+ WidgetListResponse.JSON_PROPERTY_META
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetListResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private List data = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_INCLUDED = "included";
+ private List included = null;
+
+ public static final String JSON_PROPERTY_META = "meta";
+ private WidgetSearchMeta meta;
+
+ public WidgetListResponse() {}
+
+ @JsonCreator
+ public WidgetListResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) {
+ this.data = data;
+ }
+
+ public WidgetListResponse data(List data) {
+ this.data = data;
+ for (WidgetData item : data) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public WidgetListResponse addDataItem(WidgetData dataItem) {
+ this.data.add(dataItem);
+ this.unparsed |= dataItem.unparsed;
+ return this;
+ }
+
+ /**
+ * List of widget resources.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public WidgetListResponse included(List included) {
+ this.included = included;
+ for (WidgetIncludedUser item : included) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public WidgetListResponse addIncludedItem(WidgetIncludedUser includedItem) {
+ if (this.included == null) {
+ this.included = new ArrayList<>();
+ }
+ this.included.add(includedItem);
+ this.unparsed |= includedItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Array of user resources related to the widgets.
+ *
+ * @return included
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_INCLUDED)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getIncluded() {
+ return included;
+ }
+
+ public void setIncluded(List included) {
+ this.included = included;
+ }
+
+ public WidgetListResponse meta(WidgetSearchMeta meta) {
+ this.meta = meta;
+ this.unparsed |= meta.unparsed;
+ return this;
+ }
+
+ /**
+ * Metadata about the search results.
+ *
+ * @return meta
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_META)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetSearchMeta getMeta() {
+ return meta;
+ }
+
+ public void setMeta(WidgetSearchMeta meta) {
+ this.meta = meta;
+ }
+
+ /**
+ * 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 WidgetListResponse
+ */
+ @JsonAnySetter
+ public WidgetListResponse 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 WidgetListResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetListResponse widgetListResponse = (WidgetListResponse) o;
+ return Objects.equals(this.data, widgetListResponse.data)
+ && Objects.equals(this.included, widgetListResponse.included)
+ && Objects.equals(this.meta, widgetListResponse.meta)
+ && Objects.equals(this.additionalProperties, widgetListResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, included, meta, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetListResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" included: ").append(toIndentedString(included)).append("\n");
+ sb.append(" meta: ").append(toIndentedString(meta)).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/WidgetRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipData.java
new file mode 100644
index 00000000000..3da15f37197
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipData.java
@@ -0,0 +1,173 @@
+/*
+ * 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;
+
+/** Relationship data referencing a user resource. */
+@JsonPropertyOrder({
+ WidgetRelationshipData.JSON_PROPERTY_ID,
+ WidgetRelationshipData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetRelationshipData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public WidgetRelationshipData() {}
+
+ @JsonCreator
+ public WidgetRelationshipData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) {
+ this.id = id;
+ this.type = type;
+ }
+
+ public WidgetRelationshipData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The unique identifier of the user.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public WidgetRelationshipData type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Users resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * 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 WidgetRelationshipData
+ */
+ @JsonAnySetter
+ public WidgetRelationshipData 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 WidgetRelationshipData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetRelationshipData widgetRelationshipData = (WidgetRelationshipData) o;
+ return Objects.equals(this.id, widgetRelationshipData.id)
+ && Objects.equals(this.type, widgetRelationshipData.type)
+ && Objects.equals(this.additionalProperties, widgetRelationshipData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetRelationshipData {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).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/WidgetRelationshipItem.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipItem.java
new file mode 100644
index 00000000000..0c4a91bdf84
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipItem.java
@@ -0,0 +1,136 @@
+/*
+ * 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.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;
+
+/** A JSON:API relationship to a user. */
+@JsonPropertyOrder({WidgetRelationshipItem.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetRelationshipItem {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private WidgetRelationshipData data;
+
+ public WidgetRelationshipItem data(WidgetRelationshipData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Relationship data referencing a user resource.
+ *
+ * @return data
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetRelationshipData getData() {
+ return data;
+ }
+
+ public void setData(WidgetRelationshipData data) {
+ this.data = data;
+ }
+
+ /**
+ * 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 WidgetRelationshipItem
+ */
+ @JsonAnySetter
+ public WidgetRelationshipItem 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 WidgetRelationshipItem object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetRelationshipItem widgetRelationshipItem = (WidgetRelationshipItem) o;
+ return Objects.equals(this.data, widgetRelationshipItem.data)
+ && Objects.equals(this.additionalProperties, widgetRelationshipItem.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetRelationshipItem {\n");
+ sb.append(" data: ").append(toIndentedString(data)).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/WidgetRelationships.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationships.java
new file mode 100644
index 00000000000..3e5c28faa0a
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationships.java
@@ -0,0 +1,166 @@
+/*
+ * 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.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;
+
+/** Relationships of the widget resource. */
+@JsonPropertyOrder({
+ WidgetRelationships.JSON_PROPERTY_CREATED_BY,
+ WidgetRelationships.JSON_PROPERTY_MODIFIED_BY
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetRelationships {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CREATED_BY = "created_by";
+ private WidgetRelationshipItem createdBy;
+
+ public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by";
+ private WidgetRelationshipItem modifiedBy;
+
+ public WidgetRelationships createdBy(WidgetRelationshipItem createdBy) {
+ this.createdBy = createdBy;
+ this.unparsed |= createdBy.unparsed;
+ return this;
+ }
+
+ /**
+ * A JSON:API relationship to a user.
+ *
+ * @return createdBy
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CREATED_BY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetRelationshipItem getCreatedBy() {
+ return createdBy;
+ }
+
+ public void setCreatedBy(WidgetRelationshipItem createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ public WidgetRelationships modifiedBy(WidgetRelationshipItem modifiedBy) {
+ this.modifiedBy = modifiedBy;
+ this.unparsed |= modifiedBy.unparsed;
+ return this;
+ }
+
+ /**
+ * A JSON:API relationship to a user.
+ *
+ * @return modifiedBy
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_MODIFIED_BY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WidgetRelationshipItem getModifiedBy() {
+ return modifiedBy;
+ }
+
+ public void setModifiedBy(WidgetRelationshipItem modifiedBy) {
+ this.modifiedBy = modifiedBy;
+ }
+
+ /**
+ * 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 WidgetRelationships
+ */
+ @JsonAnySetter
+ public WidgetRelationships 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 WidgetRelationships object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetRelationships widgetRelationships = (WidgetRelationships) o;
+ return Objects.equals(this.createdBy, widgetRelationships.createdBy)
+ && Objects.equals(this.modifiedBy, widgetRelationships.modifiedBy)
+ && Objects.equals(this.additionalProperties, widgetRelationships.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(createdBy, modifiedBy, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetRelationships {\n");
+ sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
+ sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).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/WidgetResponse.java b/src/main/java/com/datadog/api/client/v2/model/WidgetResponse.java
new file mode 100644
index 00000000000..aeb16df9254
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetResponse.java
@@ -0,0 +1,185 @@
+/*
+ * 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;
+
+/** Response containing a single widget. */
+@JsonPropertyOrder({WidgetResponse.JSON_PROPERTY_DATA, WidgetResponse.JSON_PROPERTY_INCLUDED})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private WidgetData data;
+
+ public static final String JSON_PROPERTY_INCLUDED = "included";
+ private List included = null;
+
+ public WidgetResponse() {}
+
+ @JsonCreator
+ public WidgetResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) WidgetData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public WidgetResponse data(WidgetData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * A widget resource object.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public WidgetData getData() {
+ return data;
+ }
+
+ public void setData(WidgetData data) {
+ this.data = data;
+ }
+
+ public WidgetResponse included(List included) {
+ this.included = included;
+ for (WidgetIncludedUser item : included) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public WidgetResponse addIncludedItem(WidgetIncludedUser includedItem) {
+ if (this.included == null) {
+ this.included = new ArrayList<>();
+ }
+ this.included.add(includedItem);
+ this.unparsed |= includedItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Array of user resources related to the widget.
+ *
+ * @return included
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_INCLUDED)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getIncluded() {
+ return included;
+ }
+
+ public void setIncluded(List included) {
+ this.included = included;
+ }
+
+ /**
+ * 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 WidgetResponse
+ */
+ @JsonAnySetter
+ public WidgetResponse 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 WidgetResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetResponse widgetResponse = (WidgetResponse) o;
+ return Objects.equals(this.data, widgetResponse.data)
+ && Objects.equals(this.included, widgetResponse.included)
+ && Objects.equals(this.additionalProperties, widgetResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, included, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" included: ").append(toIndentedString(included)).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/WidgetSearchMeta.java b/src/main/java/com/datadog/api/client/v2/model/WidgetSearchMeta.java
new file mode 100644
index 00000000000..50ea3f1850c
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetSearchMeta.java
@@ -0,0 +1,227 @@
+/*
+ * 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.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;
+
+/** Metadata about the search results. */
+@JsonPropertyOrder({
+ WidgetSearchMeta.JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL,
+ WidgetSearchMeta.JSON_PROPERTY_CREATED_BY_YOU_TOTAL,
+ WidgetSearchMeta.JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL,
+ WidgetSearchMeta.JSON_PROPERTY_FILTERED_TOTAL
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class WidgetSearchMeta {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL = "created_by_anyone_total";
+ private Long createdByAnyoneTotal;
+
+ public static final String JSON_PROPERTY_CREATED_BY_YOU_TOTAL = "created_by_you_total";
+ private Long createdByYouTotal;
+
+ public static final String JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL = "favorited_by_you_total";
+ private Long favoritedByYouTotal;
+
+ public static final String JSON_PROPERTY_FILTERED_TOTAL = "filtered_total";
+ private Long filteredTotal;
+
+ public WidgetSearchMeta createdByAnyoneTotal(Long createdByAnyoneTotal) {
+ this.createdByAnyoneTotal = createdByAnyoneTotal;
+ return this;
+ }
+
+ /**
+ * Total number of widgets created by anyone.
+ *
+ * @return createdByAnyoneTotal
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getCreatedByAnyoneTotal() {
+ return createdByAnyoneTotal;
+ }
+
+ public void setCreatedByAnyoneTotal(Long createdByAnyoneTotal) {
+ this.createdByAnyoneTotal = createdByAnyoneTotal;
+ }
+
+ public WidgetSearchMeta createdByYouTotal(Long createdByYouTotal) {
+ this.createdByYouTotal = createdByYouTotal;
+ return this;
+ }
+
+ /**
+ * Total number of widgets created by the current user.
+ *
+ * @return createdByYouTotal
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CREATED_BY_YOU_TOTAL)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getCreatedByYouTotal() {
+ return createdByYouTotal;
+ }
+
+ public void setCreatedByYouTotal(Long createdByYouTotal) {
+ this.createdByYouTotal = createdByYouTotal;
+ }
+
+ public WidgetSearchMeta favoritedByYouTotal(Long favoritedByYouTotal) {
+ this.favoritedByYouTotal = favoritedByYouTotal;
+ return this;
+ }
+
+ /**
+ * Total number of widgets favorited by the current user.
+ *
+ * @return favoritedByYouTotal
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getFavoritedByYouTotal() {
+ return favoritedByYouTotal;
+ }
+
+ public void setFavoritedByYouTotal(Long favoritedByYouTotal) {
+ this.favoritedByYouTotal = favoritedByYouTotal;
+ }
+
+ public WidgetSearchMeta filteredTotal(Long filteredTotal) {
+ this.filteredTotal = filteredTotal;
+ return this;
+ }
+
+ /**
+ * Total number of widgets matching the current filter criteria.
+ *
+ * @return filteredTotal
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_FILTERED_TOTAL)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getFilteredTotal() {
+ return filteredTotal;
+ }
+
+ public void setFilteredTotal(Long filteredTotal) {
+ this.filteredTotal = filteredTotal;
+ }
+
+ /**
+ * 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 WidgetSearchMeta
+ */
+ @JsonAnySetter
+ public WidgetSearchMeta 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 WidgetSearchMeta object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WidgetSearchMeta widgetSearchMeta = (WidgetSearchMeta) o;
+ return Objects.equals(this.createdByAnyoneTotal, widgetSearchMeta.createdByAnyoneTotal)
+ && Objects.equals(this.createdByYouTotal, widgetSearchMeta.createdByYouTotal)
+ && Objects.equals(this.favoritedByYouTotal, widgetSearchMeta.favoritedByYouTotal)
+ && Objects.equals(this.filteredTotal, widgetSearchMeta.filteredTotal)
+ && Objects.equals(this.additionalProperties, widgetSearchMeta.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ createdByAnyoneTotal,
+ createdByYouTotal,
+ favoritedByYouTotal,
+ filteredTotal,
+ additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WidgetSearchMeta {\n");
+ sb.append(" createdByAnyoneTotal: ")
+ .append(toIndentedString(createdByAnyoneTotal))
+ .append("\n");
+ sb.append(" createdByYouTotal: ").append(toIndentedString(createdByYouTotal)).append("\n");
+ sb.append(" favoritedByYouTotal: ")
+ .append(toIndentedString(favoritedByYouTotal))
+ .append("\n");
+ sb.append(" filteredTotal: ").append(toIndentedString(filteredTotal)).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/WidgetType.java b/src/main/java/com/datadog/api/client/v2/model/WidgetType.java
new file mode 100644
index 00000000000..28ca7342765
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/WidgetType.java
@@ -0,0 +1,87 @@
+/*
+ * 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.datadog.api.client.ModelEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Widget types that are allowed to be stored as individual records. This is not a complete list of
+ * dashboard and notebook widget types.
+ */
+@JsonSerialize(using = WidgetType.WidgetTypeSerializer.class)
+public class WidgetType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(
+ Arrays.asList(
+ "bar_chart",
+ "change",
+ "cloud_cost_summary",
+ "cohort",
+ "funnel",
+ "geomap",
+ "list_stream",
+ "query_table",
+ "query_value",
+ "retention_curve",
+ "sankey",
+ "sunburst",
+ "timeseries",
+ "toplist",
+ "treemap"));
+
+ public static final WidgetType BAR_CHART = new WidgetType("bar_chart");
+ public static final WidgetType CHANGE = new WidgetType("change");
+ public static final WidgetType CLOUD_COST_SUMMARY = new WidgetType("cloud_cost_summary");
+ public static final WidgetType COHORT = new WidgetType("cohort");
+ public static final WidgetType FUNNEL = new WidgetType("funnel");
+ public static final WidgetType GEOMAP = new WidgetType("geomap");
+ public static final WidgetType LIST_STREAM = new WidgetType("list_stream");
+ public static final WidgetType QUERY_TABLE = new WidgetType("query_table");
+ public static final WidgetType QUERY_VALUE = new WidgetType("query_value");
+ public static final WidgetType RETENTION_CURVE = new WidgetType("retention_curve");
+ public static final WidgetType SANKEY = new WidgetType("sankey");
+ public static final WidgetType SUNBURST = new WidgetType("sunburst");
+ public static final WidgetType TIMESERIES = new WidgetType("timeseries");
+ public static final WidgetType TOPLIST = new WidgetType("toplist");
+ public static final WidgetType TREEMAP = new WidgetType("treemap");
+
+ WidgetType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class WidgetTypeSerializer extends StdSerializer {
+ public WidgetTypeSerializer(Class t) {
+ super(t);
+ }
+
+ public WidgetTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(WidgetType value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static WidgetType fromValue(String value) {
+ return new WidgetType(value);
+ }
+}
diff --git a/src/test/resources/com/datadog/api/client/v1/api/authentication.feature b/src/test/resources/com/datadog/api/client/v1/api/authentication.feature
index b82a2313218..29acfedbf0a 100644
--- a/src/test/resources/com/datadog/api/client/v1/api/authentication.feature
+++ b/src/test/resources/com/datadog/api/client/v1/api/authentication.feature
@@ -16,12 +16,12 @@ Feature: Authentication
Given an instance of "Authentication" API
And new "Validate" request
- @skip-validation @team:DataDog/credentials-management
+ @skip-validation @team:DataDog/credential-management
Scenario: Validate API key returns "Forbidden" response
When the request is sent
Then the response status is 403 OK
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Validate API key returns "OK" response
Given a valid "apiKeyAuth" key in the system
When the request is sent
diff --git a/src/test/resources/com/datadog/api/client/v1/api/key_management.feature b/src/test/resources/com/datadog/api/client/v1/api/key_management.feature
index c3f18c2346a..222728688f2 100644
--- a/src/test/resources/com/datadog/api/client/v1/api/key_management.feature
+++ b/src/test/resources/com/datadog/api/client/v1/api/key_management.feature
@@ -12,77 +12,77 @@ Feature: Key Management
And a valid "appKeyAuth" key in the system
And an instance of "KeyManagement" API
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an API key returns "Bad Request" response
Given new "CreateAPIKey" request
And body with value {"name": "example user"}
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an API key returns "OK" response
Given new "CreateAPIKey" request
And body with value {"name": "example user"}
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an application key returns "Bad Request" response
Given new "CreateApplicationKey" request
And body with value {"name": "example user"}
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an application key returns "Conflict" response
Given new "CreateApplicationKey" request
And body with value {"name": "example user"}
When the request is sent
Then the response status is 409 Conflict
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an application key returns "OK" response
Given new "CreateApplicationKey" request
And body with value {"name": "example user"}
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an API key returns "Bad Request" response
Given new "DeleteAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an API key returns "Not Found" response
Given new "DeleteAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an API key returns "OK" response
Given new "DeleteAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an application key returns "Not Found" response
Given new "DeleteApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an application key returns "OK" response
Given new "DeleteApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an API key returns "Bad Request" response
Given new "UpdateAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -90,7 +90,7 @@ Feature: Key Management
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an API key returns "Not Found" response
Given new "UpdateAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -98,7 +98,7 @@ Feature: Key Management
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an API key returns "OK" response
Given new "UpdateAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -106,7 +106,7 @@ Feature: Key Management
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "Bad Request" response
Given new "UpdateApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -114,7 +114,7 @@ Feature: Key Management
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "Conflict" response
Given new "UpdateApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -122,7 +122,7 @@ Feature: Key Management
When the request is sent
Then the response status is 409 Conflict
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "Not Found" response
Given new "UpdateApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -130,7 +130,7 @@ Feature: Key Management
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "OK" response
Given new "UpdateApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
@@ -138,40 +138,40 @@ Feature: Key Management
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get API key returns "Not Found" response
Given new "GetAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get API key returns "OK" response
Given new "GetAPIKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all API keys returns "OK" response
Given new "ListAPIKeys" request
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all application keys returns "OK" response
Given new "ListApplicationKeys" request
When the request is sent
Then the response status is 200 OK
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get an application key returns "Not Found" response
Given new "GetApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get an application key returns "OK" response
Given new "GetApplicationKey" request
And request contains "key" parameter from "REPLACE.ME"
diff --git a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature
index 40daf9df54f..d7e706efa85 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature
+++ b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature
@@ -12,14 +12,14 @@ Feature: Key Management
And a valid "appKeyAuth" key in the system
And an instance of "KeyManagement" API
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an API key returns "Bad Request" response
Given new "CreateAPIKey" request
And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "type": "api_keys"}}
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Create an API key returns "Created" response
Given new "CreateAPIKey" request
And body with value {"data": {"type": "api_keys", "attributes": {"name": "{{ unique }}"}}}
@@ -28,7 +28,7 @@ Feature: Key Management
And the response "data.type" is equal to "api_keys"
And the response "data.attributes.name" is equal to "{{ unique }}"
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Create an Application key with scopes for current user returns "Created" response
Given new "CreateCurrentUserApplicationKey" request
And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}}}
@@ -37,14 +37,14 @@ Feature: Key Management
And the response "data.attributes.name" is equal to "{{ unique }}"
And the response "data.attributes.scopes" is equal to ["dashboards_read", "dashboards_write", "dashboards_public_share"]
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Create an application key for current user returns "Bad Request" response
Given new "CreateCurrentUserApplicationKey" request
And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "type": "application_keys"}}
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Create an application key for current user returns "Created" response
Given new "CreateCurrentUserApplicationKey" request
And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}}
@@ -53,7 +53,7 @@ Feature: Key Management
And the response "data.type" is equal to "application_keys"
And the response "data.attributes.name" is equal to "{{ unique }}"
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Delete an API key returns "No Content" response
Given there is a valid "api_key" in the system
And new "DeleteAPIKey" request
@@ -61,14 +61,14 @@ Feature: Key Management
When the request is sent
Then the response status is 204 No Content
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an API key returns "Not Found" response
Given new "DeleteAPIKey" request
And request contains "api_key_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Delete an application key owned by current user returns "No Content" response
Given there is a valid "application_key" in the system
And new "DeleteCurrentUserApplicationKey" request
@@ -76,14 +76,14 @@ Feature: Key Management
When the request is sent
Then the response status is 204 No Content
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an application key owned by current user returns "Not Found" response
Given new "DeleteCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Delete an application key returns "No Content" response
Given there is a valid "application_key" in the system
And new "DeleteApplicationKey" request
@@ -91,14 +91,14 @@ Feature: Key Management
When the request is sent
Then the response status is 204 No Content
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Delete an application key returns "Not Found" response
Given new "DeleteApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an API key returns "Bad Request" response
Given new "UpdateAPIKey" request
And request contains "api_key_id" parameter from "REPLACE.ME"
@@ -106,7 +106,7 @@ Feature: Key Management
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an API key returns "Not Found" response
Given new "UpdateAPIKey" request
And request contains "api_key_id" parameter from "REPLACE.ME"
@@ -114,7 +114,7 @@ Feature: Key Management
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Edit an API key returns "OK" response
Given there is a valid "api_key" in the system
And new "UpdateAPIKey" request
@@ -126,7 +126,7 @@ Feature: Key Management
And the response "data.id" is equal to "{{ api_key.data.id }}"
And the response "data.attributes.name" is equal to "{{ unique }}"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key owned by current user returns "Bad Request" response
Given new "UpdateCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
@@ -134,7 +134,7 @@ Feature: Key Management
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key owned by current user returns "Not Found" response
Given new "UpdateCurrentUserApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
@@ -142,7 +142,7 @@ Feature: Key Management
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Edit an application key owned by current user returns "OK" response
Given there is a valid "application_key" in the system
And new "UpdateCurrentUserApplicationKey" request
@@ -154,7 +154,7 @@ Feature: Key Management
And the response "data.id" is equal to "{{ application_key.data.id }}"
And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}-updated"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "Bad Request" response
Given new "UpdateApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
@@ -162,7 +162,7 @@ Feature: Key Management
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Edit an application key returns "Not Found" response
Given new "UpdateApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
@@ -170,7 +170,7 @@ Feature: Key Management
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Edit an application key returns "OK" response
Given there is a valid "application_key" in the system
And new "UpdateApplicationKey" request
@@ -182,14 +182,14 @@ Feature: Key Management
And the response "data.id" is equal to "{{ application_key.data.id }}"
And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}-updated"
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get API key returns "Not Found" response
Given new "GetAPIKey" request
And request contains "api_key_id" parameter with value "invalidId"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get API key returns "OK" response
Given there is a valid "api_key" in the system
And new "GetAPIKey" request
@@ -200,13 +200,13 @@ Feature: Key Management
And the response "data.id" is equal to "{{ api_key.data.id }}"
And the response "data.attributes" has field "date_last_used"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all API keys returns "Bad Request" response
Given new "ListAPIKeys" request
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get all API keys returns "OK" response
Given there is a valid "api_key" in the system
And new "ListAPIKeys" request
@@ -216,19 +216,19 @@ Feature: Key Management
And the response "data[0].type" is equal to "api_keys"
And the response "data[0].attributes" has field "date_last_used"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all application keys owned by current user returns "Bad Request" response
Given new "ListCurrentUserApplicationKeys" request
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all application keys owned by current user returns "Not Found" response
Given new "ListCurrentUserApplicationKeys" request
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get all application keys owned by current user returns "OK" response
Given new "ListCurrentUserApplicationKeys" request
When the request is sent
@@ -236,19 +236,19 @@ Feature: Key Management
And the response "data[0].type" is equal to "application_keys"
And the response "data[0].attributes" has field "last_used_at"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all application keys returns "Bad Request" response
Given new "ListApplicationKeys" request
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get all application keys returns "Not Found" response
Given new "ListApplicationKeys" request
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get all application keys returns "OK" response
Given there is a valid "application_key" in the system
And new "ListApplicationKeys" request
@@ -257,21 +257,21 @@ Feature: Key Management
And the response "data[0].type" is equal to "application_keys"
And the response "data[0].attributes" has field "last_used_at"
- @generated @skip @team:DataDog/credentials-management
+ @generated @skip @team:DataDog/credential-management
Scenario: Get an application key returns "Bad Request" response
Given new "GetApplicationKey" request
And request contains "app_key_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get an application key returns "Not Found" response
Given new "GetApplicationKey" request
And request contains "app_key_id" parameter with value "invalidId"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get an application key returns "OK" response
Given there is a valid "application_key" in the system
And new "GetApplicationKey" request
@@ -282,14 +282,14 @@ Feature: Key Management
And the response "data.id" has the same value as "application_key.data.id"
And the response "data.attributes" has field "last_used_at"
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get one application key owned by current user returns "Not Found" response
Given new "GetCurrentUserApplicationKey" request
And request contains "app_key_id" parameter with value "incorrectId"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management
+ @team:DataDog/credential-management
Scenario: Get one application key owned by current user returns "OK" response
Given there is a valid "application_key" in the system
And new "GetCurrentUserApplicationKey" request
diff --git a/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature b/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature
index 6e25db1e8f2..cad1c9e1342 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature
+++ b/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature
@@ -9,14 +9,14 @@ Feature: Service Accounts
And a valid "appKeyAuth" key in the system
And an instance of "ServiceAccounts" API
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Create a service account returns "Bad Request" response
Given new "CreateServiceAccount" request
And body with value {"data": {"attributes": {"email": "jane.doe@example.com", "service_account": true}, "relationships": {"roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "users"}}
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Create a service account returns "OK" response
Given there is a valid "role" in the system
And new "CreateServiceAccount" request
@@ -29,7 +29,7 @@ Feature: Service Accounts
And the response "data.attributes.service_account" is equal to true
And the response "data.relationships.roles.data[0].id" is equal to "{{ role.data.id }}"
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Create an application key for this service account returns "Bad Request" response
Given new "CreateServiceAccountApplicationKey" request
And request contains "service_account_id" parameter from "REPLACE.ME"
@@ -37,7 +37,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 400 Bad Request
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Create an application key for this service account returns "Created" response
Given there is a valid "service_account_user" in the system
And new "CreateServiceAccountApplicationKey" request
@@ -48,7 +48,7 @@ Feature: Service Accounts
And the response "data.attributes.name" is equal to "{{ unique }}"
And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id"
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Create an application key with scopes for this service account returns "Created" response
Given there is a valid "service_account_user" in the system
And new "CreateServiceAccountApplicationKey" request
@@ -60,7 +60,7 @@ Feature: Service Accounts
And the response "data.attributes.scopes" is equal to ["dashboards_read", "dashboards_write", "dashboards_public_share"]
And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id"
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Delete an application key for this service account returns "No Content" response
Given there is a valid "service_account_user" in the system
And there is a valid "service_account_application_key" for "service_account_user"
@@ -70,7 +70,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 204 No Content
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Delete an application key for this service account returns "Not Found" response
Given new "DeleteServiceAccountApplicationKey" request
And request contains "service_account_id" parameter from "REPLACE.ME"
@@ -78,7 +78,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 404 Not Found
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Edit an application key for this service account returns "Bad Request" response
Given new "UpdateServiceAccountApplicationKey" request
And request contains "service_account_id" parameter from "REPLACE.ME"
@@ -87,7 +87,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Edit an application key for this service account returns "Not Found" response
Given new "UpdateServiceAccountApplicationKey" request
And request contains "service_account_id" parameter from "REPLACE.ME"
@@ -96,7 +96,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Edit an application key for this service account returns "OK" response
Given there is a valid "service_account_user" in the system
And there is a valid "service_account_application_key" for "service_account_user"
@@ -110,7 +110,7 @@ Feature: Service Accounts
And the response "data.type" is equal to "application_keys"
And the response "data.id" is equal to "{{ service_account_application_key.data.id }}"
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Get one application key for this service account returns "Not Found" response
Given new "GetServiceAccountApplicationKey" request
And request contains "service_account_id" parameter from "REPLACE.ME"
@@ -118,7 +118,7 @@ Feature: Service Accounts
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: Get one application key for this service account returns "OK" response
Given there is a valid "service_account_user" in the system
And there is a valid "service_account_application_key" for "service_account_user"
@@ -131,21 +131,21 @@ Feature: Service Accounts
And the response "data.type" is equal to "application_keys"
And the response "data.id" is equal to "{{ service_account_application_key.data.id }}"
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: List application keys for this service account returns "Bad Request" response
Given new "ListServiceAccountApplicationKeys" request
And request contains "service_account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
- @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @generated @skip @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: List application keys for this service account returns "Not Found" response
Given new "ListServiceAccountApplicationKeys" request
And request contains "service_account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
- @team:DataDog/credentials-management @team:DataDog/team-aaa-identity
+ @team:DataDog/credential-management @team:DataDog/team-aaa-identity
Scenario: List application keys for this service account returns "OK" response
Given there is a valid "service_account_user" in the system
And new "ListServiceAccountApplicationKeys" 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 67596e3589c..c19cdf5452a 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
@@ -6356,6 +6356,47 @@
"type": "safe"
}
},
+ "SearchWidgets": {
+ "tag": "Widgets",
+ "undo": {
+ "type": "safe"
+ }
+ },
+ "CreateWidget": {
+ "tag": "Widgets",
+ "undo": {
+ "operationId": "DeleteWidget",
+ "parameters": [
+ {
+ "name": "experience_type",
+ "source": "experience_type"
+ },
+ {
+ "name": "uuid",
+ "source": "data.id"
+ }
+ ],
+ "type": "unsafe"
+ }
+ },
+ "DeleteWidget": {
+ "tag": "Widgets",
+ "undo": {
+ "type": "idempotent"
+ }
+ },
+ "GetWidget": {
+ "tag": "Widgets",
+ "undo": {
+ "type": "safe"
+ }
+ },
+ "UpdateWidget": {
+ "tag": "Widgets",
+ "undo": {
+ "type": "safe"
+ }
+ },
"CreateWorkflow": {
"tag": "Workflow Automation",
"undo": {
diff --git a/src/test/resources/com/datadog/api/client/v2/api/widgets.feature b/src/test/resources/com/datadog/api/client/v2/api/widgets.feature
new file mode 100644
index 00000000000..54b01571156
--- /dev/null
+++ b/src/test/resources/com/datadog/api/client/v2/api/widgets.feature
@@ -0,0 +1,115 @@
+@endpoint(widgets) @endpoint(widgets-v2)
+Feature: Widgets
+ Create, read, update, and delete saved widgets. Widgets are reusable
+ visualization components stored independently from any dashboard or
+ notebook, partitioned by experience type and identified by a UUID.
+
+ Background:
+ Given a valid "apiKeyAuth" key in the system
+ And a valid "appKeyAuth" key in the system
+ And an instance of "Widgets" API
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Create a widget returns "Bad Request" response
+ Given new "CreateWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Create a widget returns "OK" response
+ Given new "CreateWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
+ When the request is sent
+ Then the response status is 200 OK
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Delete a widget returns "Bad Request" response
+ Given new "DeleteWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Delete a widget returns "No Content" response
+ Given new "DeleteWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 204 No Content
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Delete a widget returns "Not Found" response
+ Given new "DeleteWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 404 Not Found
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Get a widget returns "Bad Request" response
+ Given new "GetWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Get a widget returns "Not Found" response
+ Given new "GetWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 404 Not Found
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Get a widget returns "OK" response
+ Given new "GetWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 200 OK
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Search widgets returns "Bad Request" response
+ Given new "SearchWidgets" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Search widgets returns "OK" response
+ Given new "SearchWidgets" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 200 OK
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Update a widget returns "Bad Request" response
+ Given new "UpdateWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Update a widget returns "Not Found" response
+ Given new "UpdateWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
+ When the request is sent
+ Then the response status is 404 Not Found
+
+ @generated @skip @team:DataDog/reporting-and-sharing
+ Scenario: Update a widget returns "OK" response
+ Given new "UpdateWidget" request
+ And request contains "experience_type" parameter from "REPLACE.ME"
+ And request contains "uuid" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}}
+ When the request is sent
+ Then the response status is 200 OK